follow the instr
requirements
Program 2-COSC 112
This assignment is based on Programming Exercise #18 on page 120 (7th edition) or #20 on page
edition). See the book description for the processing requirements, but use the handout
s below for input and output, which will require features from Chapter 3.
Input is from a file, and output is written to a file,
Input: The input file has the needed data on a single line. There is text as well as the numerical
inputs. One sample input line is
Pay rate: $15.50 per hour. Weekly hours worked: 25 17.5 30 35.75 32
A second example of an input line is
Pay rate: $12 Hours worked each week: 40 38 30.5 27.5 39
pay per hour, (2) a colon ( appears just before the five values for the number of hours worked
So, the text can vary, but you can count on (1) a dollar sign ($) appears just before the value of
each week, and (3) the hours worked values are separated by spaces.
cannot have a different version of the program for each input line.)
Your program must be able to handle ANY input line that meets these specifications. (You
Output: The output file will have a table with 2 columns. The left column has the labels telling
what each value is; labels are left-justified. The right column has the money value, with 2
decimal places. There is a dollar sign ($) to the left; the money amounts line up on the right
so all the decimal points line
up
A sample output follows. (The values are for $15 per hour, and 40 hours worked each week.)
(right-justified)
vertically.
Summer Job Income
Taxes
Income After Taxes
Clothes and Accessories
School Supplies
Remaining Money
Amount Spent on Savings Bonds
Amount Parents Spend on Bonds
и и
A A A A A A A A
3000.00
420.00
2580.00
258.00
25.80
2296.20
574.05
287.03
$
$
$