Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE205 Lecture 02

CSE205 Lecture 02

Object-Oriented Programming and Data Structures
Programming with Java
(202108)

Javier Gonzalez-Sanchez

September 12, 2021
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSE 205
    Object-Oriented Programming and
    Data Structures
    Lecture 02: Programming with Java
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    PERALTA 230U
    Office Hours: By appointment

    View full-size slide

  2. jgs
    Midterm Exam 1

    View full-size slide

  3. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 3
    jgs
    Lectures

    View full-size slide

  4. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 4
    jgs
    Day 2
    1. What is a compiler?
    2. What is Java byte code?
    3. Give an example of a lexical error in Java
    4. Give an example of a syntactic error in Java
    5. Give an example of a semantic error in Java

    View full-size slide

  5. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 5
    jgs
    Day 3
    1. What is a variable?
    2. What is a method?
    3. What is a class?
    4. Create a program that prints “This is my exam”. Including the code for
    creating a class and main method.
    5. Write 3 reserved words in Java

    View full-size slide

  6. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 6
    jgs
    Day 4
    1. Write a multi-line comment with your name and ASUID
    2. Mention the 8 primitive types defined in Java
    3. Is the following statement, correct?
    char = ' ' ';
    4. Is the following statement, correct?
    boolean result = 5 + 2 > 5 - 1 ;
    5. What is the result of (-20 % 3 -2)

    View full-size slide

  7. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 7
    jgs
    Day 5, 6
    1. What is the result of 1 % 2 - 3 / 4 * 5 / 6 + 7
    2. Is the following, correct? If so, What is the result?
    1 % 2 - 3 / 4 * 5 / 6 + 7 + “Hello”
    3. Is the following, correct? If so, What is the result?
    ”Hello” + 1 % 2 - 3 / 4 * 5 / 6 + 7
    4. Is the following, correct? If so, What is the result?
    float f = 2.5f + 2.5f; System.out.println(f);
    5. Is the following, correct? If so, What is the result?
    System.out.println( Math.pow(5.0,2.0) );

    View full-size slide

  8. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 8
    jgs
    Solution

    View full-size slide

  9. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 9
    jgs
    Day 7
    1. What is a package?
    2. What is the next instruction for?
    JOptionPane.showInputDialog(“this is a message”);
    3. What is the next instruction for?
    Integer.parseInt(“12345”);
    4. What is JOptionPane?
    5. What is showInputDialog?

    View full-size slide

  10. jgs
    To be continued…

    View full-size slide

  11. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 11
    jgs
    Questions

    View full-size slide

  12. jgs
    CSE 205 Object-Oriented Programming and Data Structures
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Fall 2021
    Copyright. These slides can only be used as study material for the class CSE205 at Arizona State University.
    They cannot be distributed or used for another purpose.

    View full-size slide