Assignment is based on programming exercise - the input


Program - COSC

This assignment is based on Programming Exercise.

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

So, the text can vary, but you can count on (1) a dollar sign ($) appears just before the value of pay per hour, (2) a colon (:) appears just before the five values for the number of hours worked each week, and (3) the hours worked values are separated by spaces.

Your program must be able to handle ANY input line that meets these specifications. (You cannot have a different version of the program for each input line.)

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 (right-justified) so all the decimal points line up vertically.

A sample output follows. (The values are for $15 per hour, and 40 hours worked each week.)

Summer Job Income                                                                $               3000.00

Taxes                                                                                   $                 420.00

Income After Taxes                                                                 $               2580.00

Clothes and Accessories                                                           $                 258.00

School Supplies                                                                      $                   25.80

Remaining Money                                                                    $               2296.20

Amount Spent on Savings Bonds                                                $                 574.05

Amount Parents Spend on Bonds                                                $                 287.03

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Assignment is based on programming exercise - the input
Reference No:- TGS0930378

Expected delivery within 24 Hours