Question: Write a MIPS program called PizzaCalc.s that is similar to the C program you wrote in Homework #1. However, instead of reading in a file,

Write a MIPS program called PizzaCalc.s that is similar to the C program you wrote in Homework #1. However, instead of reading in a file, your assembly program will read in lines of input from the console. Each line will be read in as its own input (using spims syscall support for reading in inputs of different formats). The input is a series of pizza stats, where each pizza entry is 3 input lines long. The first line is a name to identify the pizza (a string with no spaces), the second line is the diameter of the

pizza in inches (a float), and the third line is the cost of the pizza in dollars (another float).pizza in the list, the last line of the file is the string DONE. For example:

 DominosLarge 14 7.99 DominosMedium 12 6.99 DONE 

Your program should prompt the user each expected input. For example, if youre expecting the user toinput a pizza name, print to console something like Pizza name: .

Your program should output a number of lines equal to the number of pizzas, and each line is the pizza name and pizza-per-dollar (in2/USD) , which should be set to zero if either diameter or price are zero). The lines should be sorted in descending order of pizza-per-dollar, and in the case of a tie,ascending order by pizza name. An example execution of the above input is shown below:

IMPORTANT: There is no constraint on the number of pizzas, so you may not just allocate space for, say, 10 pizza records; you must accommodate an arbitrary number of pizzas. You must allocate space on the heap for this data. Code that does not accommodate an arbitrary number of pizzas will be penalized (- 75% penalty)! Furthermore, you may NOT first input all names and data into the program to first find out how many pizzas there are and *then* do a single dynamic allocation of heap space. Similarly, you

This is a homework problem. Please help and it needs to be in MIPS language with comments. Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!