Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project, you will write a MATLAB program that computes weekly employee earnings assuming a 40-hour work week and pay by the hour. An

In this project, you will write a MATLAB program that computes weekly employee earnings assuming a 40-hour work week and pay by the hour. An employee will earn an overtime rate of 1.5 times their normal hourly rate for all hours worked over 40. The program will prompt the user to provide their hourly pay rate and number of hours worked this week. The program output will be the total number of hours worked this week, the pay rate, whether overtime was worked, and the total amount of money earned by the employee that week.

If the user enters a negative value for either hours worked or pay rate, the program will indicate that value cannot be negative and will NOT compute money earned. See the examples at the end of this project description for explicit demonstrations of how the program should behave.

NB: USE MATLAB

EXAMPLE 1

Please enter your hourly pay rate: 10.00

Please enter the number of hours worked: 40

You said you worked 40 hours this week.

Your hourly pay rate is 10.0000.

You worked no overtime this week.

Your total earnings are: 400

EXAMPLE 2

Please enter your hourly pay rate: 10.00

Please enter the number of hours worked: 41

You said you worked 41.0000 hours this week.

Your hourly pay rate is 10.0000

You worked overtime this week.

Your total earnings are: 415.0000

EXAMPLE 3

Please enter your hourly pay rate: 15.10

Please enter the number of hours worked: -10

How can you work negative hours?

Program aborted!

EXAMPLE 4

Please enter your hourly pay rate: - 5.00

It is so rare to find an employee who wants to pay to work for us

Program aborted!

EXAMPLE 5

Please enter your hourly pay rate: 15.10

Please enter the number of hours worked:

Sorry! Number of hours worked cant be empty!

Program aborted!

EXAMPLE 6

Please enter your hourly pay rate:

Sorry! Hourly pay rate cant be empty!

Program aborted!

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

What is ethnocentric bias?

Answered: 1 week ago