Computers R Us would like a report that lists the orders from its online customers. The current open orders are written into an order file, “customerOrders.dat” . Print a report using the contents of this file formatted as shown in the accompanying printer spacing chart. There are computed values, too. Formulas are provided below. At the end of the report print an accumulated total for all orders.
The shipping code table contains updated shipping information and should be used to load arrays that the program will then use to determine the shipping code, and shipping charge.
- The program must be modular. The program should utilize both functions and modules. Include the following:
- A minimum of one library function. o A minimum of one custom function.
- A minimum of one module.
- Validation: o Using the shipping code table provided, check for valid shipping code. Print a message on the report instead of the detail line when an invalid code is entered. Include customer name and number in the message.
- Quantity must be at least 1. Print a message instead of the detail line when the quantity value is invalid. Include the customer name and number.
Documentation: Include the following:
- Hierarchy chart.
- Internal comments.
Extended Price of an order = quantity ordered * unit price
Order total = extended price + shipping charge
NOTE: There are no taxes required for this program.
Shipping Codes and Fees:
Input File Description: File: customerOrders.dat
|Field Description||Data Type|
|Unit Price||Real (2 decimal places)|
Output Report – Printer Spacing Chart:
Computers R Us
Current Open Orders
Customer Name Order Item Qty. Unit Ext. Ship Order Number Num. Ord. Price Price Cost Total XXXXXXXXXXXXXXX 99999 9999 999 999.99 99999.99 99.99 999999.99