Accurate Real Exam Questions and Verified
Correct Answers JUST RELEASED
What data type should you use to represent the average grade for a course? -
answer>>>double
Write a single statement that will store a true in the boolean variable tf only if boo is
negative. - answer>>>boolean tf = boo < 0;
Determine the output of the following code segments. Write no output if there is no
output.
int i = 2;int j = 3;if (j + 9 == i){ System.out.println ("You got it!");} - answer>>>no output
State what is printed:
int a = 84, b = 1;boolean boo = a != b; System.out.println(boo); - answer>>>True
Determine the output of the following code segments. Write no output if there is no
output.
int i = 2;int j = 3;if (i > j){ System.out.println ("You got it!");} - answer>>>no output
How many different values can a boolean variable hold? - answer>>>2
The ________ method is where a program starts running. - answer>>>main
Create the heading for class called Skeleton. - answer>>>public class Skeleton{}
,Consider the following code:
System.out.print("Fire");System.out.println(" Ants");
Which of the following is actually printed? - answer>>>Fire Ants
Which of the following is the most acceptable way of naming a variable? -
answer>>>groovyDude
What is the data type of the following literal?
"B" - answer>>>String (s uppercase)
What is the camel case variable name for a variable that represents the last score? -
answer>>>lastScore
Which of the following is a keyword? - answer>>>boolean
Which of the following is NOT the name of a Java primitive data type? - answer>>>String
What data type would you use to store this number?
189.24 - answer>>>double
What data type should you use to record if it is raining or not? - answer>>>boolean
What is the data type of the following literal?
"fooled you" - answer>>>String
Which of the following is equivalent to
!(a && (c < d)) - answer>>>!a || (c >= d)
, Consider the following declarations.
int valueOne, valueTwo;
Assume that valueOne and valueTwo have been initialized. Which of the following
evaluates to true if valueOne and valueTwo contain the same value? -
answer>>>valueOne == valueTwo
The boolean expression
!(A || B)
evaluates to - answer>>>true whenever both A is false and B is false.
State what's printed:
int a = 84, a= 1;boolean tf = true;System.out.println(tf && !tf); - answer>>>false
Consider the following code segment which is intended to assign true to between if x is
between lower and upper, inclusive, and false otherwise. Assume lower <= upper and all
values have been initialized.
int x;int lower;int upper;boolean between;boolean = /*missing code*/ - answer>>>(x >=
lower) && (x <= upper);
Consider the following variables that appear in a program representing student
information.
int assignmentsCompleted;double testAverage;boolean isPassing;
A student can pass a programming course if at least one of the following conditions is
met.
The student has a test average that is greater than or equal to 90.
The student has a test average that is greater than or equal to 75 and has at least 4
completed assignments.
Consider the following proposed implementations of the conditions.