Fundamental of CS
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%
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.