Ch10_Logic8e_Solutions - Programming Logic and Design 8e Solutions 10-1 Programming Logic and Design 8th Edition Chapter 10 Review Questions REVIEW

Ch10_Logic8e_Solutions - Programming Logic and Design 8e...

This preview shows page 1 - 4 out of 31 pages.

Programming Logic and Design, 8e Solutions 10-1 Programming Logic and Design, 8th Edition Chapter 10 Review Questions REVIEW QUESTIONS 1.Which of the following means the same as object ? a. classb. instancec. fieldd. category 2.Which of the following means the same as instance variable ? 3.A program that instantiates objects of another prewritten class is a(n) __________. 4.The relationship between an instance and a class is a(n) _____ relationship. 5.Which of these does not belong with the others? a. instance variableb. attributec. fieldd. object 6.The process of acquiring the traits of one’s predecessors is __________.
Programming Logic and Design, 8e Solutions 10-2 d. orientation 7.When discussing classes and objects, encapsulationmeans that _____. 8.Every class definition must contain __________. 9.Assume that a working program contains the following statement:myDog.setName("Bowser")Which of the following do you know? a. setName()is a public methodb. setName()accepts a string parameterc. both of the aboved. none of the above 10.Assume that a working program contains the following statement:name = myDog.getName()Which of the following do you know? 11.A class diagram _____. 12.Which of the following is the most likely scenario for a specific class? 13.An instance method __________. a. is static
Programming Logic and Design, 8e Solutions 10-3 b. receives a thisreferencec. both of thesed. none of these 14.Assume that you have created a class named Dogthat contains a data field named weightand an instance method named setWeight(). Further assume thatthe setWeight()method accepts a numeric parameter named weight. Which of the following statements correctly sets a Dog’s weight within the setWeight()method?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture