Question
In 2017, individual citizens and residents of Awesomeland were paid for their hourly wages using the equations shown in Table-1 below. (Matlab) i. Write a
In 2017, individual citizens and residents of Awesomeland were paid for their hourly wages using the equations shown in Table-1 below. (Matlab)
i. Write a program to calculate the amount of money a minimum wage worker would make based on this information. The program should take the number of hours worked in a week from the user as an input and then calculate and display the regular pay, overtime pay, and total amount paid to the individual. The regular pay is for hours worked between zero and forty. Overtime pay occurs for every hour or part of an hour over 40 hours in a week. The program should be robust enough to account for user input errors related to the number of hours (e.g. not negative, not more than the total number of hours in a week). If an error is found the wage should not be calculated.
ii. The wages have changed from their previous amounts paid in 2016. The changes are shown in Table-2 below. An added feature to your program was requested. The user would now like to know how much more or less money they would have made in the different years. So in addition to the number of hours from the user, a year will also be obtained as an input. The years to be entered will be either 2017 or 2016 and return an error otherwise. If an error is found the wage should not be calculated. If the user inputs 2017, inform them of how much more money they are making in total than they did in the past. If the user puts in 2016, inform them how much less they would have made in that year than in 2017
. iii. A third feature was requested at the last moment. The program should run multiple times asking each time if the user would like to run the program again. For instance, the user enters a significant letter or number (e.g. 0 to stop, or N for no more) stating they would like to determine the wage of a worker no longer.
For the test cases, when the program is run and printed out use:
a) Number of Hours = 40; Year 2017
b) Number of Hours = 55; Year 2017
c) Number of Hours = 62.5; Year 2016
d) Number of Hours = 85.25; Year 2016
e) Number of Hours = 35; Year 2018
f) Number of Hours = -5; Year 2017
Table 1. Wage values for Awesomeland in 2017 Number of Hours Wage calculation 0-40 40-60 60-80 Over 80 10 dollars per hour(DPH) 10 DPH plus 1.5 times the normal wage for each hour (or partial hour) over 40 10 DPH plus 2 times the normal wage for each hour (or partial hour) over 40 10 DPH plus 4 times the normal wage for each hour (or partial hour) over 40 Table 2. Wage values for Awesomeland in 2016 Number of Hours Wage calculation 0-40 40-60 60-80 Over 80 8.05 dollars per hour(DPH) 8.05 DPH plus 1.5 times the normal wage for each hour (or artial hour) over 40 8.05 DPH plus 2 times the normal wage for each hour (or partial hour) over 40 8.05 DPH plus 4 times the normal wage for each hour (or partial hour) over 40 Table 1. Wage values for Awesomeland in 2017 Number of Hours Wage calculation 0-40 40-60 60-80 Over 80 10 dollars per hour(DPH) 10 DPH plus 1.5 times the normal wage for each hour (or partial hour) over 40 10 DPH plus 2 times the normal wage for each hour (or partial hour) over 40 10 DPH plus 4 times the normal wage for each hour (or partial hour) over 40 Table 2. Wage values for Awesomeland in 2016 Number of Hours Wage calculation 0-40 40-60 60-80 Over 80 8.05 dollars per hour(DPH) 8.05 DPH plus 1.5 times the normal wage for each hour (or artial hour) over 40 8.05 DPH plus 2 times the normal wage for each hour (or partial hour) over 40 8.05 DPH plus 4 times the normal wage for each hour (or partial hour) over 40
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