Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this program, write a program that will act as a wage calculator for a single user. The program should use the number of hours

For this program, write a program that will act as a wage calculator for a single user. The program should use the number of hours worked and hourly wage to calculate: Gross Pay Deduction Net Pay The Gross Pay is the amount that the user is paid before any deductions are applied. The pay amount is based upon the number of hours worked. If the number of hours worked is less than or equal to 40, the gross pay is equal to number of hours worked times the hourly wage. If the number of hours worked is greater than 40, the gross pay is equal to the pay for the first 40 hours worked plus overtime pay, which is for any hour over 40 and is paid at 1.5 times the hourly wage for each hour over 40. The Deduction is based on the user's gross pay. If the gross pay is $100.00 or less, the deduction is 2% of the gross pay. If the gross pay is between $100.01 and $500.00, the deduction is 5% of the gross pay. If the gross pay is $500.01 or more, the deduction is 9% of the gross pay. The Net Pay is equal to the gross pay minus the deduction. The basic logic for this program is still similar to what has been done in programs 1 and 2: the user is asked to enter values, calculations are performed, and the results of the calculations are displayed. The new concept is that different calculations will be performed based on values entered by the user. Ask the user for the number of hours worked. This is an integer value and must be placed into an integer variable. Ask the user for the hourly wage. This is a value that can contain a decimal point and must be placed into a float or double variable. Using a decision statement and the number of hours worked, calculate the gross pay using one of the two calculations described above. Using a cascading decision statement and the calculated gross pay, calculate the deduction amount using one of the three calculations described above. Calculate the net pay. Finally, display the wage information in a table. It should include the number of hours worked, hourly wage, gross pay, deduction, and net pay. The dollar amounts should be displayed with exactly 2 digits after the decimal point.

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

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

Approximately 3.3% of youths have ODD and 3.2% have CD.

Answered: 1 week ago

Question

General Purpose of Your Speech Analyzing Your Audience

Answered: 1 week ago

Question

Ethical Speaking: Taking Responsibility for Your Speech?

Answered: 1 week ago