Question: Convert this java code to MIPS assembly: import java.util.Scanner; public class Shapes { static int a , b; public static void main ( String [

Convert this java code to MIPS assembly:
import java.util.Scanner;
public class Shapes {
static int a,b;
public static void main(String[] args){
System.out.println("welcome to the shape calculator
please choose a
shape from the menu:");
System.out.print ln("1. Square
2.Rectangle");
Scanner scn = new Scanner(
System.in);
int choice = scn. nextint () ;
switch (choice){
case 1:
System.out.print ln("Enter the side");
a=scn. nextint ();
square(a);
break;
case 2 :
System.out.print ln("Enter the first side");
a=scn.nextint ();
System.out.print ln("Enter the second side");
b=scn. nextint ();
rectang le(a,b);
default:
System.out.print ln("invalid choice");
}
break;
}
public static void square(int a){
}
rectangle(a, a);
public static void rectangle(int a, int b){
System.out.print ln("The area is: "+(a*b));
}
system.out.print The perimeter is: {:+((2***a)+(2**b)));
}
 Convert this java code to MIPS assembly: import java.util.Scanner; public class

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!