You are invited by an online company to sell some unknown items to customers. Currently this company only sells three online items. The company will give discount based on the total costs of each items. The highest costs among the three items will get a discount of 30%, the lowest costs among the three items will get a discount of 10% and the cost in between will get a discount of 20%. Of course, you can declare three constants to cater for the three discounts should the company decide to change the percentage of discounts.
We divide the design into a few tasks.
When entering to the system, the system captures the prices of the three items together with their quantities of orders. The following shows some of the interactions and displays: See image.
You can see in the above screen captured that you have to enter the price of each item together with the quantity of order of each item. You should ignore the comment that I have placed after each set of inputs.
After placing the orders, you then compute the total cost of each item and determine which item has the highest costs, the lowest costs and the middle costs; and display the following information: See image.
After knowing the highest, the lowest and the middle costs of each item, you then generate a summary of purchase. You compute the final cost of each item and add them together and display the total costs. The following shows the summary table: See image.
As can be seen from the above table, item 2 actually has the highest costs among the three items and item 1 has the lowest costs.