Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use matlab to show answer thanks In 2018, individual citizens and residents of Awesomeland were paid for their hourly wages using the equations shown

Please use matlab to show answer thanks

In 2018, individual citizens and residents of Awesomeland were paid for their hourly wages using the equations shown in Table-1 below.

1) 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 or displayed.

2) 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 2018 or 2016 and return an error otherwise. If an error is found the wage should not be calculated or displayed. If the user inputs 2018, 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 2018.

3)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 2018

b) Number of Hours = 55; Year 2018

c) Number of Hours = 62.5; Year 2016

d) Number of Hours = 85.25; Year 2016

e) Number of Hours = 36; Year 2019

f) Number of Hours = -5; Year 2018

image text in transcribed

image text in transcribed

Table 1. Wage values for Awesomeland in 2018 Number of Hours Wage calculation 0-40 10 dollars per hour(DPH) 41-55 56-80 Over 80 10 DPH for the first 40 plus 1.5 times the normal wage for each hour (or partial hour) over 40 10 DPH for the first 40 plus 2 times the normal wage for each hour (or partial hour) over 40 10 DPH for the first 40 plus 4 times the normal wage for each hour (or partial hour) over 40 Table 1. Wage values for Awesomeland in 2018 Number of Hours Wage calculation 0-40 10 dollars per hour(DPH) 41-55 56-80 Over 80 10 DPH for the first 40 plus 1.5 times the normal wage for each hour (or partial hour) over 40 10 DPH for the first 40 plus 2 times the normal wage for each hour (or partial hour) over 40 10 DPH for the first 40 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

What are some barriers to effective delegation?

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago