Question: MULTIPLE CHOICE (java programing). 8) What is the result of 45 / 4? 8) A) 11 B) 10 C) 11.25 D) 12 9) The statement

MULTIPLE CHOICE (java programing).

8) What is the result of 45 / 4?

8)

A) 11 B) 10 C) 11.25 D) 12

9) The statement System.out.printf("%10s", 123456) outputs ________. (Note: * represents a space) 9) A) 12345***** B) 23456***** C) 123456**** D) ****123456 10) What is the printout of the following switch statement? char ch = 'b'; switch (ch) { case 'a': System.out.print(ch); case 'b': System.out.print(ch); case 'c': System.out.print(ch); case 'd': System.out.print(ch); }

10) A) b B) bb C) bcd D) abcd E) bbb 11) Which of the following are valid specifiers for the printf statement? (Choose all that apply.)

11) A) %10b B) %8.2d C) %4c D) %10.2e E) %6d 12) The statement System.out.printf("%5d", 123456) outputs ________.

12) A) 23456 B) 123456 C) 12345.6 D) 12345

13) Suppose x=10 and y=10 what is x after evaluating the expression (y >= 10) || (x++> 10)? 13) A) 10 B) 9 C) 11 2

14)

How many times will the following code print "Welcome to Java"? int count= 0; do { System.out.println("Welcome to Java"); } while (++count< 10); 14) A) 11 B) 8 C) 0 D) 9 E) 10

15)

What is sum after the following loop terminates? int sum = 0; int item= 0; do { item++; sum += item; if (sum > 4) break; } while (item < 5); 15) A) 6 B) 8 C) 7 D) 5 16) Do the following two statements in (I) and (II) result in the same value in sum? (I): for (int i= 0; i<10; ++i) { sum += i; } (II): for (int i= 0; i<10; i++) { sum += i; } 16) A) Yes B) No

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!