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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started