CIS 110 All Assignments CIS 110 All Assignments | страница 16
values. Note: For example, index value 3, when applied to the “itemName” array, would give us
the name of the third item that the customer is buying. That same index value of 3, when
applied to the “pricePerPound” array, would give us the price per pound of that same third
item that the customer is buying.
Store up to five (5) values in each of the three (3) arrays.
Provide functionality in which the user ends the program by typing a sentinel value, and the
program tells the user what the sentinel value is. Note: An acceptable message may read “Type
n to end the program.”, where “n” is the sentinel value. If the user does not end the program in
this way, then the program ends when it has collected the data for five (5) items.
Print an itemized receipt with the following data after the last item in the purchase has been
saved to the array.
Item name
Price per pound of each item
Number of pounds purchased of each item
Subtotal price for each item, calculated as price per pound multiplied by the number of pounds
Total weight of the entire order (in pounds)
The cost of shipping which is based on the total weight of the entire order, calculated as 50
cents per pound. Note: For example, if the entire order weighs seven (7) pounds, the cost of
shipping would be $3.50.
Grand total price of all items and shipping.
Note: Use the “console” option in the output command to accomplish this task. An example of
an acceptable output has been provided below:
Item name
Price per pound
Number of pounds
Subtotal