In an if-else statement, if the boolean expression is false
no statements or blocks are executed.
the statement or block following the else is executed.
the first statement or block is executed.
all statements or blocks are executed.
Assume that inputFile references a Scanner object that was used to open a file. Which of the
following while loops shows the correct way to read data from the file until the end of the file is
while (inputFile.nextLine == " ")
while (inputFile != null)
What would be the value of discountRate after the following statements are executed?
If you do not provide initialization values for a class's numeric fields, they will
cause a runtime error.
contain an unknown value.
cause a compiler error.
be automatically initialized with 0.
________ operators are used to determine whether a specific relationship exists between two
Using a counter-controlled while loop, write Java code to compute the sum of the integers from 1
to 100, inclusively, and output that result to the console. You will declare the integer variable num
to count the number of executions (in the counter-controlled loop) and initialize it to 1. You will
also declare the integer variable sum to store your computation result and initialize it to 0. Be sure
to print your result to the console.
How many times will the following for loop be executed?