Tags: %TAGME{ tpaction="" web="KenyonCpp" tag="" }% view all tags

Lab 1-1

Due Sept 10, 11:59pm


  1. Starting with this lab, you must follow the guidelines on Program Style described in section 2.5 of the textbook. In particular, follow the style given in Display 2.16 (page 95) of the textbook. You will lose points if you don't. You must follow these guidelines in all future labs.
  2. For this lab all decimal point numbers must be printed with 2 digits after the decimal point. (e.g. 2.50 instead of 2.5). See pages 55-57 of the textbook for this.
An employee is paid at a rate of $16.78 per hour for the first 40 hours worked in a week. Any hours over that are paid at the overtime rate of one and one half times that. From the worker’s gross pay, 6% is withheld for social security tax, 14% is withheld for federal income tax, 5% is withheld for state income tax, and $10 per week is withheld for union dues. If the worker has three or more dependents, then an additional $35 is withheld to cover the extra cost of health insurance beyond what the employer pays. Write a program that will read in the number of hours worked in a week and the number of dependents as input, and will then output the worker’s gross pay, each withholding amount, and the net take-home pay for the week. Write your program so that it allows the calculation to be repeated as often as the user wishes.
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2015-09-08 - JimSkon
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback