Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In a statement that hasmultiple \"else if\" clauses, each \"else if\" should alw

ID: 3608923 • Letter: I

Question

In a statement that hasmultiple "else if" clauses, each "else if" should always beindented to the right of the one above it.

True
False


A program can be written in a messy and inefficient style and stillcompile without any errors and run flawlessly.
True
False


A program repeatedly asks the user for an input choice until theuser enters a "legal" (i.e., acceptable to the program designer)value. This program could use (check any options that wouldwork):

A. An "if" statementbut no loop.
B. A loop and an "if" statement.
C. A loop but no "if" statement.
D. Neither a loop nor an "if" statement.

Review


Below there are two descriptions of programming errors. Matchthe description with the kind of error it is (either a compilererror or run-time/logic error).
Match   Choice
1. Run-time (logic) Error Select A. B.   A. In aprogram that computes an average of 10 numbers you (the programmer)accidentally divide by 9 instead of 10.
2. Compiler Error Select A. B.   B. Instead ofenclosing a long literal character string in double quotes, " ...", you enclose it in single quotes, ' ... '.


It is normally preferred to pass information to a method by passingarguments to its formal parameter list rather than by using "classvariables" for this purpose.
True
False


The source code that a programmer writes which describes the exactbehavior of a method (i.e. that tells exactly what the methodshould do) is called the "method invocation".
True
False


Which of the following meanings of the plus sign, +, are built-into the language (and/or standard libraries or classes that we havebeen using with the language)?
A. Numeric addition
B. The logical "or" operation
C. Numeric exponentiation
D. Character string concatenation

Explanation / Answer

In astatement that has multiple "else if" clauses, each "else if"should always be indented to the right of the one aboveit.

True
False

False. This is notnecesarry.


A program can be written in a messy andinefficient style and still compile without any errors and runflawlessly.
True
False

True.

A programrepeatedly asks the user for an input choice until the user entersa "legal" (i.e., acceptable to the program designer) value. This program could use (check any options that wouldwork):

A. An "if" statement but no loop.
B. A loop and an "if" statement.
C. A loop but no "if" statement.
D. Neither a loop nor an "if" statement.

B. This will needboth