1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Juliette [100K]
2 years ago
6

Assume the Student and Employee classes each extend the Person class. The Student class overrides the getMoney method in the Per

son class. Consider the following code: Person p1, p2, p3; int m1, m2, m3; p1 = new Person(); m1 = p1.getMoney(); // assignment 1 p2 = new Student(); m2 = p2.getMoney(); // assignment 2 p3 = new Employee(); m3 = p3.getMoney(); // assignment 3 The reference to getMoney in assignment 3 is to the ________ class.
Computers and Technology
1 answer:
SSSSS [86.1K]2 years ago
6 0

Answer:

Person p1, p2, p3;

int m1, m2, m3;

p1 = new Person();

// assignment 1

m1 = p1.getMoney();

p2 = new Student();

// assignment 2

m2 = p2.getMoney();

p3 = new Employee();

// assignment 3

m3 = p3.getMoney();

//////////////////////////////////////////////////////////////////////////////////////////////

The reference to getMoney in assignment 3 is to the <em>Person</em> class.

Explanation:

Since Employee class didn't override Person class's getMoney() method, calling p3 with getMoney() will call Base class's (Person) getMoney() method.

You might be interested in
What is an accurate definition of a goal?
notka56 [123]

Answer:

something specific a person wants to achieve m8

Explanation:

5 0
2 years ago
Read 2 more answers
What are two reasons a network administrator would use cdp.
Ulleksa [173]

Answer:

To obtain VLAN information from directly connected switches. To determine the status of network services on a remote device. To determine the status of the routing protocols between directly connected routers .

Explanation:

6 0
2 years ago
Write a loop that fills an array int values[10] with ten random numbers between 1 and 100. Write code for two nested loops that
zalisa [80]

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int main() {

   int[] array = new int[10];

   int index = 0;

   while(index < array.size()){

           int number = (rand() % 100) + 1;

           for (int i = 0; i < 1; i++) {

               array[index] = number;

               cout<< "Position "<< index << "of the array = "<< number << endl;

               ++index;

           }

     }

}

Explanation:

The while loop in the source code loops over a set of code ten times, The for loop only loops once to add the generated random number between 1 and 100 to the array of size 10. At the end of the for loop, the index location and the item of the array is printed out on the screen. The random number is generated from the 'rand()' function of the C++ standard library.

7 0
2 years ago
You can increase your efficiency by using your e-mail program's spell checker because it eliminates the need for you to proofrea
galina1969 [7]
The answer is True bc it saves you time and is efficient
6 0
2 years ago
Which group on the Home Ribbon allows you to add shapes to a PowerPoint slide?
skad [1K]
It is under the drawings group.  
8 0
3 years ago
Read 2 more answers
Other questions:
  • In the 2007/2010 version of Paint, which of the following tools are located in the View tab? (Select all that apply.)
    5·1 answer
  • 3. The invention of the transistor was important to the development of computers because it
    5·1 answer
  • To rotate text in a cell select the option in the alignment grouping
    9·2 answers
  • Henry must choose which type of smart speaker to use in his home. He asked you to help him decide which one will best suit his n
    8·1 answer
  • The range of a finite nonempty set of $n$ real numbers $S$ is defined as the difference between the largest and smallest element
    15·1 answer
  • A_______ to show the working of an object before it is built or made. A. Prototype b. Test c. Evaluation d. Plan
    10·1 answer
  • In series connection, if we have two symmetric devices connected with 10 V battery, voltage for each device will be.. .5V or 10V
    10·1 answer
  • Buying the newest phone as soon as it is released when your current phone works perfectly is not a good idea for all but which o
    10·2 answers
  • UPS or FedEx plays what role in the supply?
    9·1 answer
  • Why does python code generate fewer types of syntax errors than code in other programming languages?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!