Your final project will be to analyze, design, and document a simple program tha
ID: 3538738 • Letter: Y
Question
Your final project will be to analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as at least one Function call and the use of at least one Array. The specific problem you need to solve for the final project is:
The BelleTubbies Toy Company would like to computerize its weekly payroll system. Only the payroll calculations are to be programmed at this time. The input to the program will contain information for each of the company's employees. This information consist of the employee's name, number of hours worked for the current week, hourly wages, number of dependents, and marital status. The last two items are needed in order to calculate exemptions and withholding tax. Write a program to compute payroll and print a report, which includes information for all of the employees.
Payroll calculations:
A. Gross Pay:
Gross Pay = Regular Number of Hours Worked * Hourly Wages + Over Time Hours * (1.5 * Hourly Wages)
Note:
B. Deductions:
Total Deduction = Marital Deduction + Dependent Deduction
C. Taxable Income:
Taxable Income = Gross Pay - Total deduction
D. Net Pay:
Use the following table to calculate tax-withholding amount in belletubby world
Taxable Income
Taxes Withheld
$0 to $150
0 percent (%) of Taxable Income
$151 to $350
10 percent (%) of Taxable Income
$351 to $500
15 percent (%) of Taxable Income
Over $501
20 percent (%) of Taxable Income
Net Pay = Gross Pay - Taxes Withheld
Taxable Income
Taxes Withheld
$0 to $150
0 percent (%) of Taxable Income
$151 to $350
10 percent (%) of Taxable Income
$351 to $500
15 percent (%) of Taxable Income
Over $501
20 percent (%) of Taxable Income
Explanation / Answer
Here is the pseudo code.
declare a String variable empName
decalre a double variable noOfHours
declare a double variable wages
declare an integer variable noOfDependents
declare a character variable maritalStatus
declare a variable grossPay of double type
declare a double variable maritalDeduction
declare a double variable dependentDeduction
declare a double variable totalDeduction
declare a double variable taxableIncome
declare a double variable taxToBePaid
while(true)
{
read employee name from the console
store into empName
read number of hours an employee worked this week
store into noOfHours
read the hourly wages from console
store into wages
read the number of dependents from console
store into noOfDependents
read the maritial status from console. Give option to enter character M for Married, S for single and D for divorced
store into maritalStatus
if (noOfHours< = 40)
then grossPay = noOfHours * wages
else
grossPay = ( 40 * wages ) + (noOfHours - 40 ) * (1.5 * wages)
if (maritalStatus == 'M' || maritalStatus =='m')
then maritalDeduction = 35
else
maritalDeduction = 0
dependentDeduction = noOfDependents * 50
totalDeduction = maritalDeduction + dependentDeduction
taxableIncome = grossPay - totalDeduction
if (taxableIncome > =0 && taxableIncome < =150)
then taxToBePaid = 0
else if (taxableIncome > =151 && taxableIncome < =350)
then taxToBePaid = 0.10 * taxableIncome
else if (taxableIncome > =351 && taxableIncome < =500)
then taxToBePaid = 0.15 * taxableIncome
else
then taxToBePaid = 0.20 * taxableIncome
print taxableIncome
print taxToBePaid
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.