Graeme FosterMember since
A cafe has a selection of menu items these are stored in an array called ITEMS, an example of which is shown below.
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:
Cake 5500 Sandwich 5000 Biscuit 2000 ... Fried Rice 6000 Wedges 2500 Orange Juice 3000
When a customer places an order the system creates a 2 dimensional array called ORDER. This array records the index of the item that they have ordered and the quantity followed by any discount which is a percentage off. For example, an order of a cake, two biscuits and three orange juices with a 20% discount on the orange juice would appear as follows
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
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.
Justify why a Queue is a good initial data structure
Justify why a Linked List is a better data structure than a Queue or Stack to hold the order after it has been served to the customer but before payment.
Suggest a reason for why the order is added to the end of the Linked List.
Suggest extra information that should be added to the order before inserting it onto the Linked List
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.
Extended Response22 MarksShared
Convert the following two's-complement binary number into its decimal equivalent: 10011011
Short Answer4 MarksShared
An array DATA holds 40 numbers. Construct an algorithm to calculate the MEAN of these numbers.
Construct an algorithm that will use the array DIFFERENCE that for each element in DATA will calculate the difference between this value and the MEAN calculated in part a. The value stored in DIFFERENCE must alway be positive. Note you do not need to show the code that calculates the MEAN.
Extended Response9 MarksShared
Contrast alpha and beta testing
Short Answer2 MarksCommunity
Explain how the OSI model helps with abstraction.
Short Answer4 MarksCommunity
James goes to a shopping mall and connects to the wifi using his mobile phone, so that he can check his email.
Outline the hardware technologies used when James checks his email.
List two advantages and two disadvantages to James using a VPN whilst at the shopping mall.
Outline why compression is important to networking
Extended Response10 MarksShared
Explain why standards are important in the construction of networks.
Short Answer3 MarksShared
With reference to the OSI model, outline two advantages of communication layers.
Short Answer4 MarksShared