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
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