Filters
Question type

Study Flashcards

What is the output of the following segment of code if the value 4 is input by the user when asked to enter a number? What is the output of the following segment of code if the value 4 is input by the user when asked to enter a number?   A) 0 B) 3 C) 13 D) 28 E) None of these


A) 0
B) 3
C) 13
D) 28
E) None of these

F) B) and E)
G) A) and B)

Correct Answer

verifed

verified

When a program lets the user know that an invalid choice has been made, this is known as:


A) input validation
B) output correction
C) compiler criticism
D) output validation
E) None of these

F) A) and D)
G) C) and D)

Correct Answer

verifed

verified

A

If you intend to place a block of statements within an if statement, you must place these around the block.


A) Parentheses ( )
B) Square brackets [ ]
C) Angle brackets < >
D) Curly braces { }
E) None of these

F) D) and E)
G) B) and C)

Correct Answer

verifed

verified

This operator is known as the logical OR operator.


A) --
B) //
C) #
D) ||
E) None of these

F) C) and D)
G) B) and C)

Correct Answer

verifed

verified

D

As a rule of style, when writing an if statement you should indent the conditionally-executed statements.

A) True
B) False

Correct Answer

verifed

verified

Without this statement appearing in a switch construct, the program "falls through" all of the statements below the one with the matching case expression.


A) break
B) exit
C) switch
D) scope
E) None of these

F) A) and D)
G) D) and E)

Correct Answer

verifed

verified

When a relational expression is false, it has the value ________.


A) one
B) zero
C) zero, one, or minus one
D) less than zero
E) None of these

F) None of the above
G) C) and D)

Correct Answer

verifed

verified

In C++ the = operator indicates:


A) equality
B) assignment
C) subtraction
D) negation
E) None of these

F) B) and E)
G) A) and D)

Correct Answer

verifed

verified

B

You should be careful when using the equality operator to compare floating point values because of potential round-off errors.

A) True
B) False

Correct Answer

verifed

verified

Given the following code segment, what is output after "result = "? Given the following code segment, what is output after  result =  ?   A) 0 B) 1 C) 2 D) 3 E) None of these


A) 0
B) 1
C) 2
D) 3
E) None of these

F) None of the above
G) A) and C)

Correct Answer

verifed

verified

What is the output of the following code? What is the output of the following code?   A) 98 B) 99 C) 0 D) 1


A) 98
B) 99
C) 0
D) 1

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

Which line in the following program will cause a compiler error? Which line in the following program will cause a compiler error?   A) 6 B) 8 C) 10 D) 9


A) 6
B) 8
C) 10
D) 9

E) A) and C)
F) B) and C)

Correct Answer

verifed

verified

What will be the output of the following code segment after the user enters 0 at the keyboard? What will be the output of the following code segment after the user enters 0 at the keyboard?   A) Nothing will be displayed. B) false C) x D) true


A) Nothing will be displayed.
B) false
C) x
D) true

E) C) and D)
F) B) and D)

Correct Answer

verifed

verified

Input values should always be checked for:


A) Appropriate range
B) Reasonableness
C) Division by zero, if division is taking place
D) All of these
E) None of these

F) B) and D)
G) A) and B)

Correct Answer

verifed

verified

Which statement allows you to properly check the char variable code to determine whether it is equal to a "C" and then output "This is a check" and then advance to a new line?


A) Which statement allows you to properly check the char variable code to determine whether it is equal to a  C  and then output  This is a check  and then advance to a new line? A)    B)    C)    D)
B) Which statement allows you to properly check the char variable code to determine whether it is equal to a  C  and then output  This is a check  and then advance to a new line? A)    B)    C)    D)
C) Which statement allows you to properly check the char variable code to determine whether it is equal to a  C  and then output  This is a check  and then advance to a new line? A)    B)    C)    D)
D) Which statement allows you to properly check the char variable code to determine whether it is equal to a  C  and then output  This is a check  and then advance to a new line? A)    B)    C)    D)

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

This operator is used in C++ to represent equality.


A) =
B) ><
C) !!
D) ==
E) None of these

F) All of the above
G) B) and D)

Correct Answer

verifed

verified

What will the following segment of code output if the value 11 is entered at the keyboard? What will the following segment of code output if the value 11 is entered at the keyboard?   A) C++ is fun B) Soccer is fun C) C++ D) C++fun E) Soccerfun


A) C++ is fun
B) Soccer is fun
C) C++
D) C++fun
E) Soccerfun

F) B) and E)
G) C) and D)

Correct Answer

verifed

verified

What is the value of donuts after the following code executes? What is the value of donuts after the following code executes?   A) 12 B) 10 C) 0 D) 2


A) 12
B) 10
C) 0
D) 2

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

What will the following segment of code output? What will the following segment of code output?   A) This is a test question! B) Congratulations! That's a high score! This is a test question! C) That's a high score! This is a test question! D) Congratulations! That's a high score! E) None of these


A) This is a test question!
B) Congratulations! That's a high score! This is a test question!
C) That's a high score! This is a test question!
D) Congratulations! That's a high score!
E) None of these

F) A) and C)
G) A) and E)

Correct Answer

verifed

verified

The following code correctly determines whether x contains a value in the range of 0 through 100. if (x >= 0 && <= 100)

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 53

Related Exams

Show Answer