Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment # 1 - Salary Payment Write a Java Program to calculate the worker gross pay. It calculates the gross pay by multiplying the number

Assignment #1- Salary Payment
Write a Java Program to calculate the worker gross pay. It calculates the gross pay by multiplying the number of hours worked by hourly pay rate. However, it is not always calculated this way. What if you work 45 hours in a week? The hours that you worked over 40 hours are considered overtime. You will need to be paid time and a half for the overtime hours you worked.
Note: The hourly pay rate is $16.00
Task ?()
Name the program, Pay.java
The program should have the following message to do the calculation part.
Display prompts and get input
"How many hours did you work?".
Input hours.
"How much are you paid per hour?".
Input rate.
Display results
"You eared $"
You should not receive any error messages.
You (programmer) should calculate several different cases by hand. Since there is a critical point at which the calculation changes, you should test three different cases: the critical point, a number above the critical point, and a number below the critical point. You want to calculate by hand so that you can check the logic of the program. Fill in the chart below with your test cases and the result you get when calculating by hand.
Execute the program using your first set of data ??Record your result. You will need to execute the program three times to test all your data.
Note: you do not need to compile again. Once the program compiles correctly once, it can be executed many times. You only need to compile again if you make changes to the code.
When this program is executed, it will ask the Payroll Department to input the hours in the message box.
\table[[Hours,Rate,Pay (hand calculated),Pay (program result)],[,,,],[,,,]]
image text in transcribed

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions