1 / 24

Lecture 13

COP3502: Introduction to CIS I. Lecture 13. Problem Set 2 due 2/15 Additional non- Sierpinski submissions accepted until 2/19. Super Session tonight 8pm-1opm E119 Discussions tomorrow (no worksheet) Super Session Thursday 8pm-10pm E119 Additional TA Office Hours.

prisca
Download Presentation

Lecture 13

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COP3502: Introduction to CIS I Lecture 13

  2. Problem Set 2 due 2/15 Additional non-Sierpinski submissions accepted until 2/19

  3. Super Session tonight 8pm-1opm E119 Discussions tomorrow (no worksheet) Super Session Thursday 8pm-10pm E119 Additional TA Office Hours

  4. Object-Oriented Programming (OOP)

  5. Object-Oriented Programming (OOP) • Everything is an object

  6. Object-Oriented Programming (OOP) • Everything is an object • Program = objects communicating through messages

  7. Object-Oriented Programming (OOP) • Everything is an object • Program = objects communicating through messages • Each object has its own memory

  8. Object-Oriented Programming (OOP) • Everything is an object • Program = objects communicating through messages • Each object has its own memory • Every object has a type

  9. Object-Oriented Programming (OOP) • Everything is an object • Program = objects communicating through messages • Each object has its own memory • Every object has a type • The type dictates what messages an object can receive

  10. everything is an object public class Hello { …} public class PrimeNumberTheorem{ … } public class Calculator { … } public class Mandelbrot { … } public class Factorial { … }

  11. a program contains objects that communicate by sending messages Car Person turnOn()

  12. a program contains objects that communicate by sending messages StdDraw Sierpinski filledPolygon()

  13. a program contains objects that communicate by sending messages StdDraw Sierpinski filledPolygon() xCoords, yCoords

  14. a program contains objects that communicate by sending messages StdDraw Sierpinski filledPolygon(xCoords, yCoords)

  15. a program contains objects that communicate by sending messages Complex Mandelbrot multiply(z)

  16. a program contains objects that communicate by sending messages Complex Mandelbrot result

  17. each object has a memory which may contain other objects Complex double real double imag

  18. each object has a memory which may contain other objects StdDraw Color penColor Double penRadius int height int width Font font Graphics2D onscreen booleanmousePressed Complex double real double imag

  19. every object has a type that dictates what kinds of messages it can receive add() Complex multiply() abs()

  20. an object’s interface tells you what kind of messages you can send StdDraw getPenColor() setPenColor() filledSquare() picture() setFont() text() setScale() show()

  21. access control public private protected

  22. interface “How do you use the object?” implementation “What are the inner workings of the object?”

  23. objects should be designed to be reused

More Related