SJSU/Udacity CS046

Lesson 2 - Objects

  1. Introduction
  2. Introducing Ellora
  3. Why OOP is Important
  4. Objects
  5. Objects Demo
  6. Quiz: Mariner 4
  7. Classes
  8. Quiz: Match the Methods
  9. Drawing Pictures
  10. Quiz: What Does This Method Do?
  11. Variables
  12. Variable Names
  13. Quiz: An Exercise on Variable Names
  14. Variable Types
  15. Quiz: Variable Types
  16. Initial Values
  17. Quiz: Initial Values
  18. Comments
  19. Quiz: How Many Days
  20. Quiz: Adding Comments
  21. Quiz: Variable Declarations: The Fine Print
  22. Variable Values Can Change
  23. Public Interfaces
  24. Public Interfaces 2
  25. Arguments and Return Values
  26. Quiz: Arguments and Return Values Exercise
  27. Method Declarations
  28. Quiz: Method Description
  29. Quiz: More Method Descriptions
  30. Constructing Objects
  31. Making Rectangles
  32. Quiz: Constructing Rectangles
  33. String Methods
  34. Quiz: The replace Method
  35. Quiz: The trim Method
  36. Quiz: toUpperCase and toLowerCase
  37. Accessors and Mutators
  38. Quiz: Accessor or Mutator?
  39. Quiz: Accessor or Mutator? 2
  40. Quiz: Pitfall
  41. Shared Objects
  42. Quiz: Copying Rectangles
  43. Quiz: Copying Strings
  44. Quiz: Copying Numbers
  45. Implementing a Test Program
  46. Quiz: Test Program
  47. Why It's Important to Test Your Code
  48. More About Graphics
  49. Quiz: Draw a Crate
  50. Quiz: Write Top Secret
  51. Quiz: Intro to Color
  52. Colors
  53. Matching Color
  54. An Interesting Project Ellora Worked On
  55. Ellora's Advice to You
  56. Conclusion

Quiz: What Does This Method Do?

What does this method do?

Make a Picture object
Pick the picture of Jonathan
Translate the picture by 100 and 100
Call the grow method and type in 50 and 50
  1. Jonathan grows 50 pixels wider and 50 pixels taller
  2. Jonathan grows 50% bigger
  3. Jonathan grows 50 pixels on each side
  4. Jonathan grows 50 years older
Run the program in BlueJ to see for yourself.

Oops. Should have checked my math. Half of 185 would be about 90 pixels, not 190.

Problem on this page?

Your name:

Your email address:

Problem description:

To protect against spam robots, please answer this simple math problem:
× =