Examlex

Solved

Example Code Ch 09-6

question 33

Multiple Choice

Example Code Ch 09-6
Assume that Student, Employee and Retired are all extended classes of Person, and all four classes have different implementations of the method getMoney. Consider the following code where ... indicates the required parameters for the constructors:
Person p = new Person(...) ;
int m1 = p.getMoney() ; // assignment 1
p = new Student(...) ;
int m2 = p.getMoney() ; // assignment 2
if (m2 < 100000)
p = new Employee(...) ;
else if (m1 > 50000)
p = new Retired(...) ;
int m3 = p.getMoney() ; // assignment 3
-Refer to Example Code Ch 09-6: The reference to getMoney() in assignment 1 is to the class


Definitions:

Diabetes

A chronic condition characterized by high levels of sugar in the blood due to the body's inability to produce or effectively use insulin.

Alopecia

A condition characterized by hair loss from the scalp or body.

Permethrin

A synthetic chemical used as an insecticide, acaricide, and insect repellent, commonly applied to clothing, bedding, and used in certain medications for treating scabies and lice.

Scarves

Lengths of fabric worn around the neck, head, or waist for warmth, cleanliness, fashion, or religious reasons.

Related Questions