Write a programming algorithm/pseudocodeto outline your programming steps in this project. This should be in a Worddocument. This will be turned in aheadof time at our next class meeting. Youmust be...










Write a programming algorithm/pseudocode
to outline your programming steps in this project. This should be in a Word
document. This will be turned in ahead
of time at our next class meeting. You
must be prepared to discuss it. Please
have a hard copy with you.














Your project will have three functions
and a driver (main) program.














You will read in a file and write out a
file with formatted output.















Use
a file to hold the output report. Define
the ofstream for the file before the main program so it does not have to be
passed. This is using the ofstream
output as a global variable.















·




You
only open a file ONCE during a program, you can write to it or read from it many
times.







·




Your
output report should have at least two pages, so after some number of records
force a page break.







·




Use
.28 as the tax rate







·




There
will a main program and 3 functions.














The input file will contain multiple
records










first name character
string, 19 characters or less.








last
name character
string, 19 characters or less.








employee
id character
string, 5 characters, all numeric.








pay
rate double value
(hourly pay rate)








benefit
indicator integer value (0 - 3)















The detail function:








(1) calculates weekly pay (40 * hourly)








(2) calculate withholding tax rate as 28%








(3) calls the benefits function to get the
cost







of the
employee’s benefits








(4) prints to the output file the detail
information








employee id, last name, first
name, hourly rate,








gross weekly salary, withholding tax, take
home pay








take home pay will be
based on








gross pay minus
taxes







and
minus the cost of deductions








(5) is
passed first and last names, employee id, pay rate,








and benefit
indicator as individual items.








(6) should return tax paid by that
individual. (double)





























The header function:








(1)





prints
header information








(2)





is
not passed any info, nor does it return any.



























The benefit function:








(1)



determines benefit amount based on the
benefit indicator.








(2)



is passed the benefit indicator (integer
value)








(3)



returns the cost of benefits as a float









(4)






Use the chart below.







Benefit Indicator Benefit Cost








0 0.00








1 8.00








2 11.00








3 13.00











Main (the driver):








(1) Opens output file, opens the input file
and reads in records








(2) determines which function to call, passes
appropriate data








(3) calculates the total tax paid by
employees








(4) Outputs the total tax on the report file.















Goals
of this program:









Creating
formatted output in a report style.








Using
files for input & output.








Understanding
how to pass a file to a function








Work
on use of functions to break up tasks















Report
generation notes:








Name your report file with an extension
of .rtf







(Rich Text
Format)







If you open it in Word you’ll see it
goes to a new page.














To force a form feed (new page) use ‘\f’ in your output line.








myoutput <>









if myoutput is what you named your
output variable;









ofstream myoutput;




















Run time instructions:







Use as input,
the text file:
Primary.txt, (Available
on Canvas and on the O: drive.)







For testing
purposes you may wish to embed prompts and run with just a couple of names or
create a small test file














The file has the following format:










first name character
string, 19 characters or less.








last
name character
string, 19 characters or less.








employee
id character
string, 5 characters








pay
rate double value
(hourly pay rate)








benefit
indicator integer value (0 - 3)





















Since the output is a text file it can
be copied and transported to other machines.















Hand in algorithm,
output file, source code and executable code.









All
of this must be in your zipped folder
















When coding your program remember the
discussion on documenting functions.
Examples are in the textbook.
Look at the Supermarket Pricing example in Chapter 5.















COMMENTS
IN THE PROGRAM ARE REQUIRED!!!!





















Objectives:








Creating
formatted output in a report style.








Understanding
passing of variables, use of pass by
reference








Using
files for input & output.















Sample Input:







Milo Minderbinder 01020 41.25 0







Mickey Mouse 02039 25.00 0







Nick Charles 03112

12.25 3







Kilgore Trout 06221 11.50 2
















There
are 25 records in the input file.





















Sample Output:







First
Name Last Name ID
Wages Taxes Take Home








Milo Minderbinder 01020
2450.00 686.00 1764.00








Mickey Mouse 02039
1400.00 392.00 1008.00








Minnie Mouse 02040
1380.00 386.40 985.60







Donald Duck 02271
980.00 274.40 694.60








Daisy Duck 02293
990.00 277.20 699.80








Nick Charles 03112
1290.00 361.20 915.80








Nora Charles 03445
3140.00 879.20 2247.80








Ford Prefect 04242
2496.80 699.10 1786.70








Irene Adler 04821
1500.00 420.00 1069.00








John Watson 04961
1550.00 434.00 1105.00







Max Bialystock 04984
1120.00 313.60 806.40








Leo Bloom 05010
1600.00 448.00 1152.00








Rocky Squirrel 05317
1150.00 322.00 828.00








Bullwinkle Moose 05318
1060.00 296.80 755.20








Steven Jobs 05400
1400.00 392.00 1000.00















-------
page break -----

















First
Name Last Name ID
Wages Taxes Take Home








Annabelle Lee 06176
1050.00 294.00 745.00







Kilgore Trout 06221
860.00 240.80 608.20








Hari Seldon 07368
1670.00 467.60 1202.40








Obiwan Kenobi 07652
740.00 207.20 519.80








Emma Peele 08080
1586.40 444.19
1129.21








John Steed 08081
1586.80 444.30 1131.50








Jane Marple 08212
1910.00 534.80 1364.20








Hercule Poirot 08336
2220.00 621.60 1590.40







Claude Bukowski 08472
1187.60 332.53 847.07








Charles Kane 08888
3120.00 873.60 2238.40
















The total tax paid
by employees is 11042.53






Oct 23, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here