; width=1125 height=1358> D. (10pt) Translate the following C codes into MIPS. (do- while loop) int n;
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
D. (10pt) Translate the following C codes into MIPS. (do- while loop) int n; cout << "Input number --> "; cin >> n; int a do { = In O sum=0; sum += a; a++; } while( a < n ); cout << "The sum by do-while-loop is > " << sum ; • Submit your program as file D.asm • Your program will be tested for several testcases, including the following: input number -> 0 . Answer: The sum by while-loop is > 1 o input number --> 1 . Answer: The sum by while-loop is > 1 o input number --> 10 . Answer: The sum by while-loop is > 45 D. (10pt) Translate the following C codes into MIPS. (do- while loop) int n; cout << "Input number --> "; cin >> n; int a do { = In O sum=0; sum += a; a++; } while( a < n ); cout << "The sum by do-while-loop is > " << sum ; • Submit your program as file D.asm • Your program will be tested for several testcases, including the following: input number -> 0 . Answer: The sum by while-loop is > 1 o input number --> 1 . Answer: The sum by while-loop is > 1 o input number --> 10 . Answer: The sum by while-loop is > 45
Expert Answer:
Answer rating: 100% (QA)
Heres a MIPS assembly code snippet that corresponds to the given C code dowhile loop da... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A permanent cut in government spending (with no change in taxation) can result in a new medium-run equilibrium with higher unemployment and lower real wages in an open economy with an...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
The site http://virtualpiano.net features an online player piano. If you click on the Key Assist menu just above the piano keyboard, and then Keyboard Keys, you will see that each key is labelled...
-
What are the final values of x and y? int x= 1, y=6; if(x>=1) if(y> 5){ X=X+2; y=y+2; } else{ X=X-1; y=y-1; } X=X+1; y=y+1;
-
Calculation the magnitude of the magnetic force on a 160-m length of straight wire stretched between two towers carrying a 150-A current. The earths magnetic field of 5.0 X 10-5 T makes an angle of...
-
Adam is going to the circus. The cost of one ticket is $15.00. The cost of each of the different snacks at the concession stand are $5.00. If he only has $30.00 total to spend, how many snacks will...
-
Briefly explain the main difference between exchange-traded funds (ETFs) and mutual funds?
-
Xemex has collected the following inventory data for the six items that it stocks: Lynn Robinson, Xemexs inventory manager, does not feel that all of the items can be controlled. What ordered...
-
On January 13, 2023, Jason, a cash basis taxpayer, was one of 3 winners of a $1.6 billion Powerball jackpot. Jason had the option to receive a one-time cash payment of $327.8 million or 30 annual...
-
a. Cyclotron resonance for a spheroidal energy surface. Consider the energy surface e(k) = h 2m, (k+ k k 2m where m, is the transverse mass parameter and m, is the longitudinal mass parame- ter. A...
-
[4 pts] Use your answer to problem 6 to estimate the mass% ethanol of a 160-gram distillate from the original 700-gram solution (200 g ethanol, 500 g water). This would be similar to collecting all...
-
What is marginal analysis?
-
Briefly, how is a project cash flow analysis constructed?
-
Describe provider incentives and risks under each of the following reimbursement methods: a. Cost-based b. Charge-based, including discounted charges c. Prospective payment d. Capitation
-
What are the four steps in capital investment financial analysis? Briefly describe them.
-
Why is financial statement analysis typically accompanied by an operational analysis?
-
A transponder is a satellite equipment which * 2 points receives a signal from Earth station and amplifies changes the frequency of the received signal O retransmits the received signal does all of...
-
Find the work done in pumping all the oil (density S = 50 pounds per cubic foot) over the edge of a cylindrical tank that stands on one of its bases. Assume that the radius of the base is 4 feet, the...
-
On February 2, 2012, Alexandra purchases a personal computer for her home. The computer cost $3,000. Alexandra uses the computer 80 percent of the time in her accounting business, 10 percent of the...
-
Teresa is a civil engineer who uses her automobile for business. Teresa drove her automobile a total of 21,732 miles during 2012, of which 95 percent was business mileage. The actual cost of...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-4. Ivan and Irene paid the following in 2012 (all by check or can otherwise be...
-
Which of the following function(s) is/are carried out by piRITS or piRISC? a. Inhibits transcription of TEs b. Causes the degradation of TE RNA c. Causes chromosome breakage d. Both a and b are...
-
Scientists propose that the first macromolecules in protobionts were a. DNA molecules. b. RNA molecules. c. proteins. d. all of the above.
-
In the CRISPR-Cas system, what does tracrRNA bind to? a. crRNA and Cas1 protein b. crRNA and Cas2 protein c. crRNA and Cas9 protein d. Cas1 and Cas2 proteins
Study smarter with the SolutionInn App