Question: Write a Java class called CalculatePay 1. For the following, store each item as a variable of the appropriate data type. Must use a different

Write a Java class called CalculatePay 1. For the following, store each item as a variable of the appropriate data type. Must use a different data type for each one.

Get the name of the user

Get the number of hours worked this week from the user

Get the hourly pay rate from the user

Get the employee type from the user, as a single character (P for part-time, F for full-time, T for temporary)

2. Calculate the total pay, and store that as another variable

3. Display the total pay to the user in this format: Hi (name) , you made $(totalPay) this week!

Where (name) is replaced with the variable you chose to store the persons name, and totalPay is replaced with the variable you chose to store the total pay

Make sure the total pay always displays 2 digits after the decimal point.

Example Output (user input is in green)

What is your name?

Bob

How many hours did you work?

40

What is your pay rate?

12.95

What type of employee are you?

F

Hi Bob, you made $518.00 this week!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!