COMP122 Week 2 iLab - Payroll and Right Triangle Program
A week 2 iLab focusing on creating a payroll program and solving right triangle problems using C++.
Daniel Kim
Contributor
4.3
50
7 months ago
Preview (3 of 9 Pages)
100%
Purchase to unlock
Page 1
Loading page ...
1COMP122 Week 2 iLab-Payroll and Right Triangle ProgramCOMP122Week2iLabCompletethe following two programs:Programming Problem 1Write a program that calculates and outputs the monthly paycheck information for anemployee, including all theamounts deducted from an employee’s gross pay, and the netpay that is due to the employee. The user of your program will knowtheemployee’sname and the gross payfor the employee. Each employee has the following deductionstaken from his gross pay:Federal Income Tax:15%State Tax:3.5%Social Security + Medicare Tax:8.5%Health Insurance$75The output from your program should be structuredas is displayed below:BillRobinsonGrossAmount:............$3575.00Federal Tax:.............$536.25StateTax:............... $125.13Social Sec / Medicare:... $ 303.88Health Insurance: ........ $75.00NetPay: ................. $2534.75Your program should deal with erroneous input values. Gross salary should always be apositive number. Make sure that you deal with the possibility that the user may haveentered a non-numeric input value. Have your program output appropriate error messagesin these cases.1. Identify the inputs and outputs of theproblem.•Employee name (string)•Gross pay (positive numeric value)Outputs:•Employee name (string)•Gross pay•Federal Tax (15% of gross pay)
Page 2
Page 3
Preview Mode
This document has 9 pages. Sign in to access the full document!