CS3 Programming Assignment 1 salary calculator solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

Write a program to read the data for a list of employees from a file and calculate their salary and print them to
the monitor in a tabular format, refer to the sample below. Terminate the program when all data from the file
are read. Data for an employee includes full name, filing status (J or j for joint and S or s for single), and
taxable income on one line. The program must verify salary (positive numbers only) and status (can only be
joint or single), if invalid data is entered print an error message and continue to the next employee. Use the
table below to find tax rate:
SINGLE TAXPAYERS
If The Taxable Income Is … Computed Tax
Is …
Over But Not Over Of Amount Over
$0 $1710 No Tax
$1710 $20930 $87.00 plus 3.0% $1710
$20930 $28790 $742.40 plus 8.0% $20930
$28790 And over $1449.60 plus 11.0% $28790
JOINT TAXPAYERS
If The Taxable Income Is … Computed Tax Is …
Over But Not
Over
Of Amount
Over
$0 $3420 No Tax
$3420 $47120 $330.00 plus 4.0% $3420
$47120 $57580 $1905.40 plus 9.0% $47120
$57580 And over $2899.20 plus 11.0% $57580
Requirements:
Must use input file and prompt user to enter file name.
Must include at least 4 methods in addition to main
Must use at least 1 static class variable
Must check all exceptions using try and catch statement
Must use arrays to store the data
Below is a sample input file:
Joseph Kardian
j 539590.00
Bill Jones
X 8976.0
Nancy Brown
j -9087.0
Marty Klauss
S 3390.58
Below is a sample output 1:
Enter file name: data.txt
Program Number 1
Programmer Joe Blake
Class Computer Science 3
Name Status Gross Salary Taxes Net Salary
==============================================================
Joseph Kardian Joint $539590.00 $55920.30 $483669.70
Bill Jones X is invalid input
Nancy Brown Joint Negative salary is invalid
Marty Klauss Single $3390.58 $0.00 $3390.58
——————————————————————————-
Averages $XXXXX.XX $XXXX.XX $XXXX.XX
Program terminated on request.
Thank you for using tax program. Have a nice day.
Below is a sample output 2: (if the data file was not found)
Enter file name: data.txt
File “data.txt” was not found, program terminated.