Please read the entire problem before jumping into the code!
Using the in-class examples and practice test as a guide, modify the solution to Practical 8 to use a safe array to hold your data read from a file.
The following are the exact instructions from that original Practical:
CO311: Introduction to Modern Programming IILab Practical #8: March 27, 2000Please read the entire problem before jumping into the code! Your boss at the hardware store wants you to help him develop software to automate his billing process. Hes already bought some hardware that will scan and put a list of items into a file. Your task is to write a program that will do the following:
The scanning machine can only handle up to 50 items, so your input file will never have more items than that, but you wont know ahead of time how many items are actually recorded in the file. At this point, you shouldnt worry about duplicate items in the file: treat each line as an individual item. You do know, however, that there is one record per line in the following format: 328712 Hammer 15.75 Each record consists of three components:
Example input: 328712 Hammer 15.75 33274 Pliers 8.95 1000456 Bolt-cutter 38.99 43234 Screwdriver 8.95 9833321 Fencing 75.00 Example output: Hammer (328712) $15.75 Pliers (33274) $8.95 Bolt-cutter (1000456) $38.99 Screwdriver (43234) $8.95 Fencing (9833321) $75.00 ------------------------------- Subtotal: $147.64 Tax (5%): $7.382 Total: $155.022 Use good programming methods, including separate functions where appropriate. A copy of a sample file (order.txt) can be found in the COMMON area of the FTP site under practicals/p8. Submit the finished CPP file to the FTP site in its own folder called P8. |
Your class definition, implementation and driver program should be in separate files as appropriate. If you want them reviewed, submit your copies to the FTP site in a separate folder called P13PREP and send email to jim3@millard.org.