$30 off During Our Annual Pro Sale. View Details »

CSE110 Lecture 15

CSE110 Lecture 15

Principles of Programming with Java
Object-Oriented Programming
(202005)

Javier Gonzalez-Sanchez
PRO

June 08, 2017
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. CSE110
    Principles of Programming
    with Java
    Lecture 15:
    Object-Oriented Programming
    Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    Office Hours: By appointment

    View Slide

  2. Previously

    View Slide

  3. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 4
    Problem
    • Create a program for Quizzes
    • Specifically to test your Arithmetic skills
    • For instance 75 + 31 =
    • Let us start with only additions and 2 digits numbers
    • Could the computer grade the Quiz?
    • Show the students her/his grade

    View Slide

  4. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 5

    View Slide

  5. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 6
    class
    main()

    View Slide

  6. Level Up

    View Slide

  7. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 8
    class
    Where we are?
    main()

    View Slide

  8. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 9
    class
    What is next?
    main()
    class
    class
    class

    View Slide

  9. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 10
    Everything is an object
    CSE470
    Computer
    Graphics
    CSE412
    Databases
    objects
    objects

    View Slide

  10. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 11
    Object-Oriented Paradigm
    everything is an entity (object)
    A program is a collection of objects working together
    main()

    View Slide

  11. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 12
    class
    Where we are?
    main()
    class
    create a new entity/object
    use the entity/object

    View Slide

  12. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 13
    Object-Oriented Paradigm
    public class MyProgram {
    public static void main(String [] arg)
    {
    Student john = new Student();
    john.name = "John Doe";
    john.sayHello();
    john.drawSomething();
    }
    }
    public class Student {
    String name;
    int finalGrade;
    public void sayHello(){
    // print name
    }
    public void drawSomething(){
    // draw
    }
    }

    View Slide

  13. View Slide

  14. View Slide

  15. Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 16
    Reference
    Pages 362 - 367

    View Slide

  16. CSE110 - Principles of Programming
    Javier Gonzalez-Sanchez
    [email protected]
    Summer 2020
    Disclaimer. These slides can only be used as study material for the class CSE110 at ASU. They cannot be distributed or used for another purpose.

    View Slide