Question: Q1. Given the following java code. Complete the missing statements by answering the questions below: (84-32 points) 1. 2. public class 3. ( main(Stringlargs): ):

Q1. Given the following java code. Complete the missing statements by answering the questions below: (84-32 points) 1. 2. public class 3. ( main(Stringlargs): "): 1. 5. System.out.println(" 6. 7. 8. System.out.println("The result is ):) ) 1. State that a program will calculate the sums the squares of two integers. 2. Complete Line 2 by assigning a name of the class. 3. Complete line 3 4. Create a scanner called reader that reads values from the standard anput. 5. Prompt the user to enter two integers. 6. Declare two variables a and b to be of type int 7. Read the two integer numbers from the user and store them in the variables and b. 8. Compute and display the sum of aand b-use Math.pow()). Q2. Identify if there is an error(s) or not, if it is correct the errors in each of the following: (4x10-40 points) 1. int i = 3: doubleks+ 2. double i = 3.5: int k = Math.pow(1,2) 3. public class test1 public static void main(Stringlargs) { int System.out.printini++): 4. public class Test // the output should be: The result is s public static void main(String args) { Scanner input-new Scanner(System.in); System.out.println("Please enter an integer"); int mumher input.nextInt(): // Assume that the user enters System.out.println("The result is "+"number: Q3. Write a program that evaluates the following expression: (28 points) r = 3xy + 2x - (%2) for x=2 and y 4: Using online Java compiler (such as Covida https://www.covidala or Online https://www.onlinegdb.com), run the above code and show the output? Then manually, solve the equation illustrating each step, and compare your solution with output of the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
