Question

Quiz2 Q1 A worker is paid according to his hourly wage up to 40 hours, and 50% more for overtime. Write a program in a script

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION:-

%MATLAB CODE:-

h=input('enter number of hours (h)');

w=input('enter hourly wage (w)');

pay=0;

if h>40

pay=h*w+(h-40)*0.5*w;

else

pay=h*w;

end

fprintf("pay = %.2f",pay)

%end of MATLAB CODE:-

%test case and output:-

Add a comment
Know the answer?
Add Answer to:
Quiz2 Q1 A worker is paid according to his hourly wage up to 40 hours, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Quiz2 Q1 A worker is paid according to his hourly wage up to 40 hours, and...

    Quiz2 Q1 A worker is paid according to his hourly wage up to 40 hours, and 50% more for overtime. Write a program in a script file that calculates the pay to a worker. The program asks the user to enter the number of hours (h) and the hourly wage (w). The program then displays the pay. pay=h*wi for h<=40, pay=h*w+(h-40) *0.5*w for h>40 Q2

  • Use loops to generate a fully formatted plot of the following piecewise functions on the given do...

    How to solve by using Matlab?(loops) Use loops to generate a fully formatted plot of the following piecewise functions on the given domain with three different colors. If the piece is a single point, use a different marker to mark the point. Part A should be on one plot and Part B should be on a separate plot. 1. Part A: p(x)3-3 3 Ks2 (x-3)2 x >2 Part B: n-2 x>2 Use loops to generate a fully formatted plot of...

  • Create a Text file containing the following data (without the headings): Name            Wage      Hours Callaway, G 16.00       40 Hanson, P     15.00      48 Lasard, D      16.50      35 Stillman,...

    Create a Text file containing the following data (without the headings): Name            Wage      Hours Callaway, G 16.00       40 Hanson, P     15.00      48 Lasard, D      16.50      35 Stillman, W   18.00      50 Write a C++ program that uses the information in the file to produce the following pay report for each employee: Name, Pay Rate, Hours, Regular Pay, Overtime Pay, Gross Pay       Compute regular pay as  any hours worked up to and including 40 hours multiplied by the pay rate. Compute overtime...

  • Acme Parts runs a small factory and employs workers who are paid one of three hourly...

    Acme Parts runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift, $17 per hour; second shift, $18.50 per hour; third shift, $22 per hour. Each factory worker might work any number of hours per week; any hours greater than 40 are paid at one and one-half times the usual rate. In addition, second- and third-shift workers can elect to participate in the retirement plan for which 3% of...

  • Mike Dooley's regular hourly wage is $16 an hour. He receives overtime pay at the rate...

    Mike Dooley's regular hourly wage is $16 an hour. He receives overtime pay at the rate of time and a half. The FICA tax rate is 7.65%. Mike is paid weekly. For the first pay period in January, Mike worked 49 hours. All hours over 40 earn the overtime rate. Mike's federal income tax withholding is $150 and his state income tax withholding is $60. Mike has authorized that $25 be withheld from his check each pay period for savings...

  • A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who...

    A company pays its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and “time-and-a-half,” i.e. 1.5 times their hourly wage, for overtime hours worked), commission workers (who receive $250 plus 5.7% of their gross weekly sales), or pieceworkers (who receive a fixed amount of money per item for each of the items they produce-each pieceworker in this company works on only one...

  • Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a...

    Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a wage calculator for a single user. The program will use the user's number of hours worked and their hourly wage to calculate: Gross Pay Deduction Net Pay The Gross Pay is the amount that the user is paid before any deduction is applied. The pay amount is based upon the number of hours worked. If 40 hours or less were worked, the gross pay...

  • use at least two functions in your program. . Write a program that calculates weekly payment....

    use at least two functions in your program. . Write a program that calculates weekly payment. The program will ask the user full name, ID number (make one up), and hours worked. An hourly worker’s gross pay is basically his/her work hours that week multiplied by his/her regular hourly pay rate. However, after the first 40 work hours of the week, each additional work hour is paid at an overtime rate that is 1.5 times of the regular hourly rate....

  • Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user...

    Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user for type of employee (hourly ("h"or "H") or management ("'m" or "M") If the employee is management: . get the annual salary get the pay period (weekly ("w" or "W"), bi-weekly ("b" or "B") or monthly ("m" or e compute the gross salary for the pay period (Divide annual salary by 52 for weekly, 26 for bi-weekly, and 12 for monthly) deduct from gross...

  • Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of...

    Logic Exercise 40 Points This exercise tests your ability to understand logic in the form of IF Statements. You will be given the rules and the data that will follow the logic. At the end of the explanation, a series of questions will be asked. Place your answers in the area provided. Program explanation - You are provided with pseudocode that calculates the total amount of money to pay an employee after working for 1 week. The amount of money...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT