Title | Computer Programming 2 - Midterm Exam Midterm Exam |
---|---|
Course | Computer Programming 2 |
Institution | AMA Computer University |
Pages | 17 |
File Size | 331.4 KB |
File Type | |
Total Downloads | 1 |
Total Views | 869 |
Not yet answered Marked out of 1.Question 2Not yet answered Marked out of 1.Which of the following is a valid method name: Select one: a. compute b. int c. None of these d. final e. compute grade Clear my choiceWhat is the output of the code snippet below: int[] intArray = new int[10]; for(int x = 0...
Question 1 Not yet answered Marked out of 1.00
Which of the following is a valid method name: Select one: a. compute b. int c. None of these d. final e. compute grade Clear my choice
Question 2 Not yet answered Marked out of 1.00
What is the output of the code snippet below: int[] intArray = new int[10]; for(int x = 0; xy) Clear my choice
Question 7 Not yet answered Marked out of 1.00
Which of the following is a valid multidimensional array? Select one: a. int[][][] intArray; b. int intArray[][][]; c. All of these d. int[][] intArray; e. int[][][][] intArray; Clear my choice
Question 8 Not yet answered Marked out of 1.00
What is the return value of this method: int test(){return 1;} ? Select one: a. All of the choices b. return 1 c. 1 d. int e. test Clear my choice
Question 9 Not yet answered Marked out of 1.00
what will be the output if you execute this code? int x=1; switch(x){ case 1: System.out.print(“1”); case 2: System.out.print(“1”); case 3: System.out.print(“1”); default: System.out.print(“1”); } Select one: a. display 1 b. display 1111 c. display 1234 d. display nothing e. None of these Clear my choice
Question 10 Not yet answered Marked out of 1.00
What is the output of the code snippet below: void main(){test(“11”);test(“1”);} void test(String x){System.out.print(x + x);} Select one: a. 6 b. 111111 c. None of the choices d. 222 Clear my choice
Question 11 Not yet answered Marked out of 1.00
What will be the output if you execute this code? do{System.out.println("Hello World!");}while(false);
Select one: a. print "Hello World"
b. print "Hello World" infinitely
c. None of these d. The code will not run because of syntax error
e. Do nothing
Clear my choice
Question 12 Not yet answered Marked out of 1.00
What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 }; Select one: a. 4 b. None of the choices c. 7 d. 6 e. 5 Clear my choice
Question 13 Not yet answered Marked out of 2.00
What will be the value of x after you execute this statement int z=0; for(int x=0; xy) c. if (xy) d. None of these e. if (x...