apcsa 1.4

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

In the code segment below, assume that the int variables a and b have been properly declared and initialized. int c = a; int d = b; c += 3; d--; double num = c; num /= d; Which of the following best describes the behavior of the code segment?

B The code segment stores the value of (a + 3) / (b - 1) in the variable num.

Consider the following code segment. int a = 5; int b = 4; int c = 2; a *= 3; b += a; b /= c; System.out.print(b); What is printed when the code segment is executed?

C 9

Consider the following code segment. int a = 4; int b = 5; a++; b++; int c = a + b; a -= 1; System.out.println(a + c); What is printed when the code segment is executed?

D 15

Consider the following code segment, where k and count are properly declared and initialized int variables. k++; k++; count++; k--; count++; k--; Which of the following best describes the behavior of the code segment?

D The code segment leaves k unchanged and increases count by 2.

Consider the following code segment. num += num; num *= num; Assume that num has been previously declared and initialized to contain an integer value. Which of the following best describes the behavior of the code segment?

D The value of num is the square of twice its original value.

Consider the following code segment. int x = 5; x += 6 * 2; x -= 3 / 2; What value is stored in x after the code segment executes?

E 16


Set pelajaran terkait

B.4 CompTIA Network+ N10-008 Certification Practice Exam

View Set

Biology 1301 Final Exam-Connect Quiz

View Set

Health Assessment Ch. 13 Eye Assessment (Prep U)

View Set

hazmat #2, Hazardous material response!!!!!!!

View Set

comparison b/t ich gcp e6 and us fda regulations

View Set

Prepu Ch.53, 54 KIDNEY (Medsurg book)

View Set

Chapter 21-24 Economics Test Review

View Set

Lower Limb (Gray's Anatomy Review, BRS, Lippincott)

View Set

Intestinal Obstructions (Sherpath)

View Set