Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem [35 marks] Give monthly payroll information (filename: MonthlyPayroll.java) Write a program that asks an employee for the income of the month, total earnings year-to-date,

Problem [35 marks] Give monthly payroll information

(filename: MonthlyPayroll.java)

Write a program that asks an employee for the income of the month, total earnings year-to-date, total CPP deducted year-to-date, and total EI deduction year-to-date as the sample shown below:

Enter your income for the month: 4000

Enter your total earnings year-to-date: 10000

Enter your CPP deducted year-to-date: 100

Enter your EI deducted year-to-date: 50

The program then calculates the employee's federal tax, provincial tax, CPP deduction, EI deduction, total payroll deduction, and the paycheck amount.

Create a method for each of the following 7 steps. You must design the algorithms for both the programmer-defined methods and the main method.

Note that the total earnings below is the total earnings year-to-date plus this month's income.

  1. The federal tax calculation is simplified as follows:

If the total earnings is less than $13,000, the federal tax is 0, else if the total earnings is less than $20000, the federal tax is 10% of the income, else if the total earnings is less than 40000, the federal tax is 15% of the income, else the federal tax is 20% of the income.

  1. The provincial tax calculation is simplified as follows:

If the total earnings is less than $11,000, the provincial tax is 0, else if the total earnings is less than $15000, the provincial tax is 8% of the income, else if the total earnings is less than 30000, the provincial tax is 12% of the income, else the provincial tax is 16% of the income.

  1. The CPP calculation is simplified as follows:

If the total earnings is less than $3,500, the CPP contribution is 0, else the contribution rate for employees is 5.45% (of income). The maximum an employee can contribute for the year is $3,166.45

  1. The EI calculation is simplified as follows:

The EI premium rate is 1.58% (of income), for a maximum annual premium of $889.54

  1. The total payroll deduction is the sum of federal tax, provincial tax, CPP deduction, and EI deduction

  1. The paycheck amount for the employee is the income for the month minus the total payroll deduction

  1. Display the payroll information as the sample shown below (keep two decimals for all the numbers):

Your payroll details are as follows:

Income: $ 4000.00

Federal Tax: $ 400.00

Provincial Tax: $ 320.00

CPP Deduction: $ 218.00

EI Deduction: $ 63.20

Paycheck: $ 2998.80

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago