Question: Write a program that calculates an employee's weekly income based on the number of hours worked, and their hourly pay as follows: Ask the user
Write a program that calculates an employee's weekly income based on the number of hours worked, and their hourly pay as follows:
Ask the user to enter their name. Save this into a variable. Name it properly.
Ask the user to enter their hourly rate. Show them a prompt that looks like the following: Sarah, what is your hourly rate?
Replacing Sarah for their atual name which you got in step
Save the hourly rate in a variable and note you should convert the into to a floating point number.
Ask the user to enter their total hours for the week. Use their name as you did in step when using input. Save the answer into another variable. The input of this step should be converted into an integer.
Calculate the total wages for the employee and save the result in a variable.
Show the result, using the output that resembles the following:
Sarah, your check for this week should be $
where Sarah should be replaced by the user's actual name and xy is the total amount of the wages as a floating point number.
It is important to: use variables to get input, think of the proper data type for each input, and produce the proper output.
Use conversions when needed and do not add conversions if not needed as this causes point deductions.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
