Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java and C# I have been struggling with this prject for a few days now and it is driving me insane. some help would be

Java and C#

I have been struggling with this prject for a few days now and it is driving me insane. some help would be much appreciated

Write a program called DeductionCalculator that calculates a payroll deduction. The user will enter gross pay, a deduction code, and a deduction value. Deductions can be a percentage, a fixed amount, or none based on a deduction code. The three values must be entered before you perform the if or switch statement. In other words, you enter the three values, test the deduction code and then perform the calculation. Write a program to allow a user to enter the three values, calculate the deduction, and display the three input values and the amount of the deduction.

Deductions are calculated as follows:

Deduction code = N: Deduction is zero.

Deduction code = F: Deduction is a fixed amount and the deduction value entered is dollars and cents.

Deduction code = P: Deduction is a percent of gross pay and the deduction value entered is a decimal percentage. The percentage must be less than or equal to .60 (60%). If the percentage is greater than 60%, make the percentage 60%.

Regardless of the deduction type, the deduction amount cannot exceed the gross pay. However, the deduction may cause the gross pay to be zero. If a deduction exceeds gross pay, set the deduction amount equal to gross pay.

Your program should output the three input values and the calculated deduction.

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Do your staff and customers know these examples?

Answered: 1 week ago

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

3. What may be the goal of the team?

Answered: 1 week ago