Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java code please Problem Statement Code an executable program that will calculate and display an employee's pay as illustrated in the Sample Runs below. Your

java code please image text in transcribed
Problem Statement Code an executable program that will calculate and display an employee's pay as illustrated in the Sample Runs below. Your program must prompt the user for a name, hours worked, hourly pay rate, and whether or not a bonus should be added. Hours worked is an integer (whole) number. The hourly pay rate may include pennies (decimal positions). The earned amount is calculated as the hours worked multiplied by the hourly pay rate. The bonus is added to the earned amount if indicated (the user will enter a l if the bonus is to be added into the earned amount). Pay is calculated as the earned amount minus tax. Tax is 25% of the earned amount Your program must: 1. use variables with data types that reflect the data. 2. use a named constant called RATE to identify the .25 tax rate. 3. use a named constant called BONUS to identify the $100 bonus amount 4. use printf to display decimals: System.out.printf("Item String: $%.2f ", variable Value); %.2f is used to display calculated value with two and only two decimal positions. 5. Add comments to your code to indicate what you are doing Two sample runs: Enter employee's name: John Enter hours worked : 40 Enter hourly pay rate: 15.5 Include bonus (1-yes, Beno) : 1 I Day calculated for John Hours worked: 40 Hourly pay rate: $15.5 Bonus included: $100.0 Earned amount: $720.00 Calculated taxes: $180.00 Enter employee's namet lack Enter hours worked: Enter hourly pay rate: 15.5 Include bonus (1 yes, Brno) ! 1 Pay calculated for Jack Hours worked 40 Hourly pay rate: $15.5 Bonus not included. Earned amount: $620.00 Calculated taxes: $155.ee Net pay for John is: $540.00 Net pay for Jack is: 5.465.00

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_2

Step: 3

blur-text-image_3

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

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions