Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Frank has been given a class named HourlyEmployee . An object of this class has the following instance variables: String name; int hoursPerWeek; double hourlyWage;
Frank has been given a class named HourlyEmployee.
- An object of this class has the following instance variables:
- String name;
- int hoursPerWeek;
- double hourlyWage;
- The class constructor has the following signature: public HourlyEmployee(String person, int hours, double perHour)
HourlyEmployee has methods getName(), getHoursPerWeek() and getHourlyWage() that return the current contents of the objects instance variables.
Frank is writing a separate class will use HourlyEmployee. Frank has set up an HourlyEmployee object named emp1 in main() of this class. He now wants to print the weekly paycheck amount for this employee.
You are to write statement(s) to insert into main() that will calculate and print the amount of the employees paycheck for the week.
- You are not writing main(); just write statements so that the required task is performed (the workers weekly pay amount is printed in main()).
- Write your statement(s) exactly so that they can be cut and pasted directly into main() and the program will operate as desired.
- Do not worry about any fancy formatting for the information printed. Just be sure that the employees weekly pay amount is printed in main().
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started