Examlex

Solved

Example Code Ch 09-6

question 28

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 2 is to the class


Definitions:

Y-Intercept

The point at which a line crosses the y-axis in a Cartesian coordinate system.

Linear Regression

A statistical method used to model the relationship between a dependent variable and one or more independent variables by fitting a linear equation to observed data.

Predicted Value

An estimated value calculated within the context of a statistical model based on existing observations and variables.

Y-Intercept

The point where a line crosses the Y-axis in a graph or chart.

Related Questions