Computers and Technology

For the questions below, 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 ... are 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

The reference to getMoney( ) in assignment 2 is to the class?

Question 18 options:

A)
Retired

B)
Employee

C)
Person

D)
Student

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:30, kprincess16r
Why is it a good idea to leave an interview being courteous and polite?
Answers: 1
image
Computers and Technology, 22.06.2019 11:50, nicoleskertich
You have written, as part of a school assignment, a research paper on the solar system. you want to share this paper on your school website. on which type of server will you upload it?
Answers: 1
image
Computers and Technology, 23.06.2019 21:00, tiffg2588
Will this setup result in what kathy wants to print?
Answers: 2
image
Computers and Technology, 23.06.2019 22:50, christingle2004
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
Do you know the correct answer?
For the questions below, assume that Student, Employee and Retired are all extended classes of Perso...

Questions in other subjects:

Konu
Chemistry, 03.02.2022 23:20
Konu
Mathematics, 03.02.2022 23:20