Question 5 Here is some pseudocode that uses object-oriented programming: Match
ID: 3579772 • Letter: Q
Question
Question 5
Here is some pseudocode that uses object-oriented programming:
Match each highlighted part of of the pseudocode to the term that describes it.
Question 5 options:
method call
object
method
Class name
member variable, field, or property
Parent class
AlcoholicIngredient
Ingredient
_volume
calc_total_alcohol
ingredient
ingredient.input
Question 6
Which of the following statements is most correct?
Question 6 options:
An object is an instance of a class.
A class is like a house; an object is like the blueprint for that house.
"Class" and "object" are different terms for the same thing.
A class is an instance of an object.
Question 7
Match each term below with the best description.
Question 7 options:
Everything you know about a class and everything you know how to do with that class are contained within the class definition.
Each subclass provides the same interface so that outside code doesn't have to know what kind of subclass is being referenced. For example, a SquareShape provides a draw method that draws squares, while a CircleShape provides a draw method that draws circles. Outside code just tells the object to draw, without needing to know whether a circle or a square will be drawn.
Properties and methods that are common to all subclasses are contained within a parent class. Child classes can access these properties and methods as if they were defined as part of the child class.
Certain properties and methods of a class are marked "Private" and can only be accessed through a "Public" interface. This gives the programmer a certain amount of freedom to change the implementation, without breaking anyone else's code.
Encapsulation
Data Hiding
Inheritance
Polymorphism
Question 8
Here is a UML diagram:
Match the parts of this diagram to the terms that describe them.
Question 8 options:
Public or private
Setters or mutators
Properties, fields, or member variables
Getters or accessors
Constructor
Data types
Class name
CellPhone in top box of UML diagram
manufacturer, modelNumber, retailPrice
CellPhone(...) in bottom box of UML diagram
setManufacturer, setModelNumber, setRetailPrice
getManufacturer, getModelNumber, getRetailPrice
String, Real
+, -
method call
object
method
Class name
member variable, field, or property
Parent class
1.AlcoholicIngredient
2.Ingredient
3._volume
4.calc_total_alcohol
5.ingredient
6.ingredient.input
Cell Phone manufacturer String modelNumber String retail Price Real CellPhone (manufact String, modelNum String, retail Real) setManufacturer (manufact String) setModelNumber (modNum String) setRetailPrice (retail Real) getManufacturer( String getModelNumber( String getRetail Price(): RealExplanation / Answer
Question 5)
method call -> ingredient.input
object -> ingredient
method -> calc_total_alcohol
Class name -> AlcoholicIngredient
member variable, field or property -> _volume
Parent class -> Ingredient
Question 6)
An object is an instance of a class.
Question 7)
i) Encapsulation
ii ) Inheritance
iii) Polymorphism
iv) Abstraction.
Question 8)
Public or private -> +,-
Setters or mutators -> setManufacturer,setModelNumber,setRetailPrice
Getters or acessors -> getManufacturer, getModelNumber, getRetailPrice
Constuctor -> CellPhone(...) in the bottom box of UML diagram
Data types -> String,Real
Class name -> CellPhone in the top box of UML diagram
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.