Solution Cart

Remove item Thumbnail image Product Price Quantity Subtotal
× 1. Write a program in MARIE assembly language to perform the following code segment. Test your code thoroughly using the MARIE simulator with values of X=10, X=20, and X=30. What is the value stored in X and Y by the end of execution? Include comments for each line of instruction in your program (12 points). X=10 Y=0 while X!=0 do Y=X X=X-1 endwhile while X!=0 do Y=X X=X-1 endwhile 2. Consider the following program in MARIE assembly language. Complete the table detailing the RTN for the next 3 instructions only that will be executed including the content of registers PC, IR, MAR, MBR, and AC in hexadecimal. Note the first instruction LOAD X is already filled. Note also that the SKIPCOND instruction has no operands, therefore you can complete Fetch, decode and execute cycles only. Explain in one statement what this program is doing (14 points). ORG 000 LOAD X ; AC = X Repeat, ADD One ; AC = X + 1 SKIPCOND 000 ; if AC < 0 then PC = PC + 1 (skip) JUMP End ; Go to End STORE X ; X = AC JUMP Repeat ; Go to Repeat End, STORE X ; Stop (end of program) This program is incrementing the value of X by 1 repeatedly until the value in AC becomes negative. 3. Assume a main memory has the following hex values in the first two bytes: Byte 0: 8F Byte 1: 0F What is the actual decimal value stored in these bytes, assuming they are in 16-bit 2's complement representation and the machine is using: a) Big endian memory b) Little endian memory (4 points) a) In big endian memory, the byte order is reversed. So, the actual decimal value stored in these bytes would be -7. b) In little endian memory, the byte order remains the same. So, the actual decimal value stored in these bytes would be 36655. 4. Consider the assembly program (in MARIE) below and the corresponding memory address for each instruction. Show the symbol table that will be constructed by the assembler after the first pass including the translated program, then fill in the final machine code produced by the assembler after the second pass. Fill in the given tables using HEX numbers for instructions and addresses. (10 points) [Symbol Table] LOAD 0100 ADD 0101 STORE 0110 SUBT 0111 JUMP 1000 Dec1 0001 [First Pass] 0100 LOAD X ; Load value at address X to AC 0101 ADD Y ; Add value at address Y to AC 0110 STORE Z ; Store value in AC to address Z 0111 SUBT X ; Subtract value at address X from AC 1000 JUMP Z ; Jump to address Z [Second Pass] 0100 1005 ; Load X 0101 5006 ; Add Y 0110 210B ; Store Z 0111 1015 ; Subtract X 1000 4010 ; Jump Z 1 Write a program in MARIE assembly language to perform following code segment Test your code $10.00
$10.00
× You are required to develop a takeaway order management system for a restaurant that delivers pizza and pasta. Your program should maintain a list of customer orders that need to be delivered at any one time. When first run, it should present the user with a menu with the following options: 1. Enter the details of a customer order, which is then added to the order list. 2. Deliver an order, and remove it from the list. The next order to be delivered should always be the order that has been on the list for the longest time. The details of the delivered order should be printed to the screen. 3. Print out details of all the orders in the list. 4. Exit the program. This menu should continue running in a loop until Option 4 is selected by the user. An order's details consist of: - a list of food items - a customer name - a customer contact number - a delivery address - the meal type of the order, i.e., whether or not it is vegetarian, vegan, or contains meat. This information should be determined by the program, based on the food items contained in the order. If there is any food item with meat in the order, then the order's meal type is classed as 'meat'. If there are no meat items but some vegetarian items, then the order is classed as 'vegetarian'. For an order to be classed as 'vegan', there must be no food items that are meat or vegetarian. - a total cost, which is calculated by the program. This is the sum of the prices of all the food items in the order. - A pizza has a list of toppings, which can be one or more of any combination of the following six items: ham, cheese, pineapple, mushrooms, tomato, seafood. For a pizza to be vegetarian, it must not contain ham or seafood. For a pizza to be vegan, it must not contain ham, seafood, or cheese. - A pasta meal has only a single topping, which is one of the following four items: bolognese (meat), marinara (meat), primavera (vegetarian), tomato (vegan). - Pizza and pasta without any toppings can be assumed to be vegan. Each food item also has an associated price, which is calculated by the program as follows: - The base price of either a pizza or pasta meal is $11.50. - Each pizza topping adds an extra $2, except pineapple which adds $2.50 and seafood which adds $3.50. - For the pasta toppings, tomato adds $4, bolognese and primavera each add $5.20, and marinara adds $6.80. For full marks, your design should contain all of the following: - inheritance, with an abstract class as the super class. - an interface which ensures that the price and meal type can always be retrieved from both food items and orders - at least one enum type - at least four classes overall (including the abstract class). Code design and correctness (35 marks) High-level functionality (7 marks) - Implementing overall main menu structure correctly - Adding an entered order correctly to the order list - Removing the oldest order from the order list, and printing that order's details to the screen (using appropriate calls to toString methods) - Printing all order details (using appropriate calls to toString methods) Correctly retrieving and storing order details (8 marks) - Storing the customer's name, contact number, and delivery address with the order - Allowing the user to enter a list of food items, which are stored with the order - Allowing the user to define multiple toppings for each pizza item, and a single topping for each pasta item Price and meal type calculations (8 marks) - Ensuring prices of orders and food items are calculated and reported correctly - Ensuring meal types (meat/vegetarian/vegan) of orders and food items are calculated and reported correctly Design requirements (12 marks) - Sensible overall class design and adherence to good design principles - Modularisation of complex tasks within classes - Validation checks on user input - Appropriate and correct use of inheritance - Appropriate and correct use of an abstract class - Correct use of an interface to ensure price and meal type are implemented as required - Appropriate and correct use of enum type You are required to develop a takeaway order management system for a restaurant that delivers pizza… $10.00
$10.00

Cart totals

Subtotal $20.00
Total $20.00

You may be interested in…

Free Worldwide shipping

On all orders above $50

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

PayPal / MasterCard / Visa