(a).A cafe has a selection of menu items these are stored in an array called ITEMS, an example of which is shown below.
[6] ITEMS = [ "Cake", "Sandwich", "Biscuit", ... , "Fried Rice", "Wedges", "Orange Juice"]
It also has an array called PRICES, which holds the price of each item, an example of which is shown below:
PRICES = [ 5500, 5000, 2000, ... , 6000, 2500, 3000]
The PRICES and ITEMS arrays are parallel arrays. Write some code that will write to a string array called MENU where each element of this array will hold the item followed by its price. Note, to align the information the price will be displayed in the 16th column, all prices are four digits long and the program doesn't need to check this. The variable MENU has already been created and is of the correct length.
An example of the contents of this string is given below:
ORDER = [ [ 0, 1, 0], [2, 2, 0], [12, 3, 20] ] // assume that Orange Juice has an index of 12
Construct the algorithm that will calculate the total bill. For example the above order would cost
5500×1+2000×2+(3000×3)×100(100−20)=16700 (c).Customers arrive at the cafe and place an order, their food will be prepared and then served to their table and after eating their food they will pay for their food.
The customers ORDER is first placed in a Queue and once the ORDER has been completed the ORDER is added to the end of a Linked List called PAYMENTS.
(iii).Suggest a reason for why the order is added to the end of the Linked List.
[1] (iv).Suggest extra information that should be added to the order before inserting it onto the Linked List
[1] (v).Construct the algorithm that will take an ORDER from the Queue called ORDERS and insert at the end of the Linked List called PAYMENTS. The PAYMENTS Linked List uses a Node called PAYMENT_NODE which you may assume has been created but id empty. You may assume that the PAYMENTS Linked List is not empty.
[5]