The method header includes it's accessibility modifier (for example, public), return type, name and parameters. For example, for getTotalPay() below, it's header is: public double getTotalPay( int numMonths ). Assume that you have a Manager class that inherits from the Employee class below. Given the getTotalPay () method in the Employee base class, write the method header for a method in the Manager class that overrides getTotalPay (). /** Represents a generic employee with only a salary */ public class Employee{ protected double salary; // pay amount per month /** * Calculates the amount paid to the employee based on the number of months specified @param numMonths Number of months * Greturn The amount paid to the employee for numMonths months */ public double getTotalPay( int numMonths )( * numMonths: return salary

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question
100%
Need help asap:
The method header includes it's accessibility modifier (for example, public), return
type, name and parameters. For example, for getTotalPay() below, it's header is:
public double getTotalPay( int numMonths ).
Assume that you have a Manager class that inherits from the Employee
class below. Given the getTotalPay () method in the Employee base class,
write the method header for a method in the Manager class that overrides
getTotalPay ().
/**
* Represents a generic employee with only a salary
*/
public class Employee{
protected double salary; // pay amount per month
/**
Calculates the amount paid to the employee based on the number of months specified
@param numMonths Number of months
* Greturn The amount paid to the employee for numMonths months
*/
public double getrotalPay( int numMonths ) (
return salary * numMonths:
10
f8
1+
fio
f12
ins
prt sc
dele
&
6.
L.
8.
9.
back
Y
Transcribed Image Text:The method header includes it's accessibility modifier (for example, public), return type, name and parameters. For example, for getTotalPay() below, it's header is: public double getTotalPay( int numMonths ). Assume that you have a Manager class that inherits from the Employee class below. Given the getTotalPay () method in the Employee base class, write the method header for a method in the Manager class that overrides getTotalPay (). /** * Represents a generic employee with only a salary */ public class Employee{ protected double salary; // pay amount per month /** Calculates the amount paid to the employee based on the number of months specified @param numMonths Number of months * Greturn The amount paid to the employee for numMonths months */ public double getrotalPay( int numMonths ) ( return salary * numMonths: 10 f8 1+ fio f12 ins prt sc dele & 6. L. 8. 9. back Y
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Uniform Resource Indicator
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage