Question
Translate this Java code into MIPS Assembly - This must be written as a switch statement. Use seq to check each case. Write a program
Translate this Java code into MIPS Assembly -This must be written as a switch statement. Use seq to check each case.
Write a program that implements the Grade Calculator shown below:
______________________________________________________________________
/** Grade Calculator receives a grade from the student and returns their letter grade
*/
public class GradeCalculator { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int percent; char grade; System.out.print("Enter your final grade percent > "); percent = stdin.nextInt(); switch(percent/10) { case 10 : case 9 : grade = 'A'; break; case 8 : grade = 'B'; break; case 7 : grade = 'C'; break; case 6 : grade = 'D'; break; default : grade = 'F'; } System.out.println("Your final grade is " + grade); } } _________________________________________________ 2) Your output should formatted as shown below:
Sample Output
Enter your final grade percent > 89 Your final grade is B
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