Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java Assignment 6- MIT Employment! Foo Corporation needs a program to calculate how much to pay their hourly employees. The US Department of Labor

image text in transcribedIn java

Assignment 6- MIT Employment! Foo Corporation needs a program to calculate how much to pay their hourly employees. The US Department of Labor requires that employees get paid time and a half for any hours over 40 that they work in a single week. For example, if an employee works 45 hours, they get 5 hours of overtime, at 1.5 times their base pay. The State of Massachusetts requires that hourly employees be paid at least $8.00 an hour. Foo Corp requires that an employee not work more than 60 hours in a week. Summary of Rules An employee gets paid (hours worked) x (base pay), for each hour up to 40 hours For every hour over 40, they get overtime (base pay) x 1.5 The base pay must not be less than the minimum wage ($8.00 an hour). If it is, print an error. If the number of hours is greater than 60, print an error message Directions Create a new class called Foocorporation Write a method that takes the base pay and hours worked as parameters, and prints the total pay or an error. Write a main method that calls this method for each of these employees: Base Pay Employee $7.50 $8.20 Employee 3 $10.00 Hours Worked 35 47 73 Employee2 Hint Do not try to write the entire program in one go. It is much easier to write a small piece and test it, then write another small piece and tes t. For example, start by writing just a skeleton of your method and your main program. Then add the code to do the normal salary computation, without any special rules. Then add each additional rule, one at a time. You should test your program with simple test inputs to check that you handle each case. Good luck! Instructions for Submission 1. Include your group members who are PRESENT in line 1 of your code 2. Submit the .java file as an attachment using the E-Learning Assignment tool

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions