224k views
0 votes
Here is some pseudocode that uses object-oriented programming:

Class AlcoholicIngredient Extends Ingredient
Private Real _volume
Private String _name
Private Real _proof
Public Module input()
Call Ingredient.input()
Set _proof = input_real("What proof is " + _name + "? ")
End Module
Public Function Real calc_total_alcohol()
Return _volume * _proof / 200.0
End Function
End Class
Ingredient ingredient = New Ingredient()
Call ingredient.input()
Match each highlighted part of of the pseudocode to the term that describes it.
A. AlcoholicIngredient
B. Ingredient
C. volume
D. calc_total_alcohol
E. ingredient
F. ingredient.inpu
1. method call
2. object
3. method
4. Class name
5. member variable, field, or property
6. Parent class

User Wuarmin
by
4.0k points

1 Answer

2 votes

Answer:

Step-by-step explanation:

Using the code snippet in the question, each of the following terms would be considered the...

AlcoholicIngredient = Class Name

Ingredient = Parent Class

volume = member variable, field, or property

calc_total_alcohol = method

ingredient = object

ingredient.input = method call

These would be the classification of each of these terms in the snippet of Object-Oriented Programming Code. The terms after the keyword Class is the Class Name. The term after the keyword extends is the Parent Class. The term volume comes after the keyword Real meaning its an integer variable. cacl_total_alcohol comes after the Public Function keyword making it a method. The variable ingredient comes after the Ingredient Class Name and is being equalled to an ingredient constructor making it an object of class Ingredient. Lastly, the ingredient.input() is calling the input method that exists within the Ingredient class.

User Degger
by
4.3k points