50 likes | 173 Views
Programming Assignment #2 in CIS12. Please use speaker notes for additional information!. Customer.dat. The file layout is: 1 - 6 Customer Number 7 - 26 Customer Name 27 - 46 Product 47 - 51 Standard Price 52 - 53 Classification.
E N D
Programming Assignment #2 in CIS12 Please use speaker notes for additional information!
Customer.dat The file layout is: 1 - 6 Customer Number 7 - 26 Customer Name 27 - 46 Product 47 - 51 Standard Price 52 - 53 Classification Note that the standard price is 5 characters made up of 3 whole numbers and 2 decimal numbers. 121212Stephen DanielsJean Shorts0150002 123456Jennifer Ames Sandals 0299901 144445SusanRichards Sweater 0499501 145678John SmithTank Top0109904 212121LindaCosta Socks 0029910 242424MichaelFletcher Suit 2259501 252728RussellWarrenCoat 1999801 272817Ann Washington Gown 5000001 300456DickSouthworthSweatshirt 0159902 454567MaryStretton Bathrobe 0259701
Output requirements The detail output should include the following: Customer Number - this is taken directly from the input record Customer Name - this is taken directly from the input record Product - this is taken directly from the input record Standard Price - this is taken directly from the input record (3 whole numbers, 2 decimal) Customer Special Price - this is the result of a calculation - this is handled differently depending on whether the classification code is 01, 02, 04 or 10 Classification Name - a different name is printed depending on whether the classification code is 01, 02, 04, or 10 The total output should include the number of records processed in each classification - therefore, the program should add to different counters depending on whether the classification code is 01, 02, 04, or 10. NOTE: There should be four totals.
Classification codes • Recommendation: • I would suggest that in the loop where you are processing the records, you check the classification code. There are three things to do dependent on that classification code: • Calculate the special price • Move the classification name to the printer • Add to the appropriate classification counter
Possible output The calculated price and the classification name are the last two fields - the other data comes directly from the input. 121212 Stephen DanielsJean Shorts$15.00 $15.00 Steady 123456 Jennifer Ames Sandals $29.99 $26.99Excellent 144445 SusanRichards Sweater $49.95 $44.95Excellent 145678 John SmithTank Top$10.99 $12.08 Irregular 212121 LindaCostaSocks $2.99 $4.28Problem Note that there are additional records - this is only partial output.