Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C Program will add the coursework array marks to the exam array marks and store them in the results array. Assume the number of students
C Program will add the coursework array marks to the exam array marks and store them in the results array. Assume the number of students is The program will then increase the marks in the results array if half of the students fail. Note that CURVE is a function called by the main program. Additionally, the program will create counters for the number of students with a result and
Write the equivalent MIPS assembly code for the Ccode shown. Remember to add comments to your assembly code. DONT USE SYSCALL RATHER JAL or JR Dont worry about setting a feature to only allow total marks to be or marks for coursework or exam to be just assume data should be put in should be less.
MAIN PROGRAM
int a b c f; Declare results counters
int i; Declare loop counter
int y; Declare total number of students
y ; Initialize y
a; b; c; f; Initialize results counters
int coursework ; Coursework is an array to store
the coursework marks that goes
from to
int exam ; Exam is an array to store the exam
marks that goes from to
int results ; Results is an array to store the
total marks coursework exam. And the sorted total marks.
It goes from to
for i; i h
d ; d the highest
mark in your results array
for i; i and
f ;
for i; i
a a ;
else ifresultsi
b b ;
else ifresultsi
c c ;
else
f f ;
Main program code ends here
CURVE function code
void CURVE int p int z int k
pz pz k;
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