Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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