Fundamental of CS
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →CSC 2250 Fundamentals of Computing System Lab 2 1. (40 points): below is a java program that prompts user to enter an integer and then calculate the expression y = 3*x*x + 5*x +8, and display the result. public static void main(String[] args) { Scanner myScanner = new Scanner(System.in); System.out.print(“Enter an integer value: “); int x = myScanner.nextInt(); int y = 3*x*x + 5*x + 8; System.out.println(“The result is: ” + y); } The sample run for the java program above: Write a MIPS program to compute the expression as the Java program does. (1) Screenshot of your program: [Load your program into QtSPIM and run your program. Take a screenshot showing program code and register values.] (2) Test cases (screenshot of result, showing input/output): 2. (60 points): Write a SPIM program that computes the volume and surface area of a rectangular parallelepiped. The formulas for calculating volume and surface area are as follows: • π£π£π£π£π£π£π£π£π£π£π£π£ = ππππππ where ππ, ππ, ππ are the sides of rectangular parallelepiped respectively. • π π π π π π π π π π π π π π π π π π π π π π = 2(ππππ + ππππ + ππππ) Your SPIM program • defines variables ππ, ππ, ππ, π£π£π£π£π£π£π£π£π£π£π£π£, and π π π π π π π π π π π π π π π π π π π π π π • prompts user to enter three integers and store them to variable ππ, ππ, ππ respectively • computes the volume and stores the value to the variable π£π£π£π£π£π£π£π£π£π£π£π£ • computes the surface area of the rectangular parallelepiped and stores result to the variable π π π π π π π π π π π π π π π π π π π π π π . • Display the results like this: for example, the volume is 8 and the surface area is 10 The volume of the rectangular parallelepiped is 8 The surface of the rectangular parallelepiped is 10 (1) Screenshot of your program: [Load your program into QtSPIM and run your program. Take a screenshot showing program code and register values.] (2) Test cases (screenshot of result, showing input/output): Program Grading Rubric Each program is graded using the following rules: (1) Your program is assembled successfully: 30% (2) Your program works as expected: 50 % (3) Your program follows style guidelines, including correct program header: 10 % (4) Your program is commented properly 10%
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds