FINAL ACTUAL EXAM PAPER 2026
QUESTIONS WITH ANSWERS GRADED
A+
◍ A,D.
Answer: In a certain game, the integer variable bonus is assigned a value
based on the value of the integer variable score.If score is greater than 100,
bonus is assigned a value that is 10 times score.If score is between 50 and
100 inclusive, bonus is assigned the value of score.If score is less than 50,
bonus is assigned a value of 0.Which of the following code segments
assigns bonus correctly for all possible integer values of score ?Select two
answers.AIF(score > 100){bonus ← score * 10}ELSE{IF(score ≥
50){bonus ← score}ELSE{bonus ← 0}}BIF(score ≥ 50){IF(score >
100){bonus ← score * 10}ELSE{bonus ← 0}}ELSE{bonus ←
score}CIF(score < 50){bonus ← 0}ELSE{IF(score ≥ 50){bonus ←
score}ELSE{bonus ← score * 10}}DIF(score < 50){bonus ←
0}ELSE{IF(score > 100){bonus ← score * 10}ELSE{bonus ← score}}
◍ Declaration of an Array as a String.
Answer: String [] name = new String[12];
◍ In Java, What is the first value of any array.
Answer: 0
◍ Declaration of an Array as a Double.
Answer: double [] numbers = new double[2];
◍ Declaration of an Array as a Integer.
Answer: int [] x = new int[3];
, ◍ What does the number declare when initializing a new array value?.
Answer: The number of spaces there will be in the array
◍ If you were to have 4 spaces in an array how you you add value to each
space.
Answer: String [] name = new String[4]; String[0] = "TJ Roe"; String[1] =
"Patrick Lee"; String[2] = "Jarod Funk"; String[3] = "Jesus Christ the
homeboy";
◍ Integer.MAX_VALUE;.
Answer: 2^31 - 1
◍ Integer.MIN_VALUE;.
Answer: -2^31;
◍ Matrix.
Answer: A rectangular array of numbers or other mathematical objects, for
which operations such as addition and multiplication are defined.
◍ printf();.
Answer: Method that solves for formatting problems in code. Use is
Recommended or typical print() and println()
◍ Format Specifier imbedded within String literal.
Answer: 1. The leading percent sign (%) 2. Optional flag or specifier 3. A
converter (s, d, or f) s = lowercase string S = UPPERCASE STRING d =
double f = float
◍ For-Each Loop.
Answer: for(String person : names) { System.out.println(person); }
◍ For Loop.
Answer: for (int index = 0; index <= 9; i++) {
System.out.println(names[index]);}
◍ Writing Arithmetic Statments.
Answer: When Writing Arithmetic Statements you can't declare variables
like you typically would in math. Remember if you are reusing a variable