CECS 282
LAB ASSIGNMENT #1
Assigned date: 8/28
Due date: 8/31
15 points
Problem 1 [5 points] - Output format
Write a program that calculates and prints monthly paycheck for an employee. The net pay is calculated after taking the following deductions:
Federal Income Tax: 20%
State Tax: 4%
Social Security Tax: 3.5%
Medicare/Medicaid Tax: 2.75%
Pension Plan: 6%
Health Insurance: $80.0
Your program should prompt the user to input the gross amount. Format your output to have two decimal places. A sample output follows:
Gross amount: 3587.00Gross amount: | $ | 3587.00 |
Federal Tax: |
$ | 717.40 |
State Tax: | $ | 143.48 |
Social Security Tax: | $ | 125.55 |
Medicare/Medicaid Tax: | $ | 98.64 |
Pension Plan: | $ | 215.22 |
Health Insurance: | $ | 80.00 |
Net Pay: | $ | 2206.71 |
Note: The bold letters means the computer displays the output. The normal letters means you enter the input.
Net pay = gross amount -(federal tax + state tax + social security tax + Medicare/Medicaid Tax + Pension Plan + Health Insurance)
Hints: You should be able to complete the program with the hints below.
//Display output
Your coding
Problem 2 [5 points]
Write a program that displays the sum of all odd digits of an input.
Problem 3 [5 points]
Write a program that displays the factors of a specified integer.
Grading