Answered step by step
Verified Expert Solution
Question
1 Approved Answer
cnallenge: mprovea Annua vvage ca cuiator Description: Write a Python 3 program called wage _ calculator.py that accepts user input from the keyboard for the
cnallenge: mprovea Annua vvage cacuiator
Description: Write a Python program called wagecalculator.py that accepts user input from the keyboard for the hours worked and hourly wage. The program calculates the total wages for
the year, assuming the person works days per year and taxes are deducted from the wages. The program is to handle exceptions and not crash based on user input. A negative value
for hours worked or hourly wage are not to be accepted from the user. And, after each calculation the user is to be prompted if they want to perform another calculation.
Purpose: Provide experience with writing an interactive Python program that accepts input, performs a calculation, then displays the result as output.
Requirements:
Your program needs to:
Ask the user to input from the keyboard for two inputs, one is the hours worked daily and the other is the hourly wage. Multiplying hours worked daily and hourly wage will give you the
wages earned in a day.
The two input numbers are not necessarily integers. For example, the user can enter values like for hours worked or for hourly wage.
Calculate the yearly wage given the two inputs
Note that the working hours is daily. Assume the user works days per year and the same amount of hours every day.
It would help to first write down the mathematical formula needed to calculate the yearly wage
will be deducted from yearly earnings for taxes
Print the a Pay Advice containing:
hours worked
hourly wage
wages before taxes
tax amount
annual wages after taxes
money values should be printed with a $ sign and all numbers should be rounded to decimal places
The following are additional requirements for this challenge:
User input may not cause the program to crash. Exceptions from invalid user input must be handled gracefully. The user is to be given feedback about invalid input and given the
opportunity to supply the input without needing to run the program again.
Negative values for hours worked and hourly wage are not to be accepted from the user. If a negative value is provided the user is to be given feedback and asked again for the value.
After each calculation the user is to be prompted if they want to perform another calculation. If they answer with a then they are to be prompted for new input and another calculation
is to be performed. If they provide any other response the program is to exit.
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