2 years ago
C++ CONFIRMED PAST QUESTIONS AND
SOLUTIONS
LIKELY EXAMINATION QUESTIONS
1. Within the switch statement, the ….
Clause can contain one or more statements to be executed when the selected
expression does not match any of the …. Clauses.
a. Case, default
b. Break, case
c. Default, case
d. If, else
2. A pretest loop and protest loop
produce the same results; they just use different methods.
a. True
b. false
3. a stream is defined in c++ as a
sequence of numeric valves
a. true
b. false
4. A processing items in an IPO chart
represents an intermediate value that the algorithm uses when processing the
input into the output.
a. True
b. False
5. With whom should a programmer have an
extensive interaction before converting a solution to problem into a computer
program?
a. System engineer
b. Compiler vender
c. Language developer
d. User
6. Which stream manipulator can be used
to advance the cursor to the next line on the computer screen?
a. Cout
b. Cin
c. endl
d. endline
7. Which symbol in flowchart is known as
the decision symbol?
a. Diamond
b. Parallelogram
c. Oval
d. Rectangle
8. A key word is a word that has special
meaning in the programing language you are using.
a. True
b. False
9. A variable is a memory location whose
valve can change during routine.
a. True
b. False
10.
With
what type of program does the programmer focus on structures that represent
screen elements such as check boxes and buttons or structures that represent
real world items such as an employee or time card?
a. Machine language
b. Object-oriented
c. Procedure-oriented
d. Assemble language
11.
With
a do while statement, the looping condition indicates the requirement for the
….. the loop body instructions.
a. Exiting
b. Repeating
c. Reversing
d. Printing
12.
Which
type of structure makes decision based on one or more conditions?
a. Iteration
b. Question
c. Looping
d. Selection
13.
Which
structure do you use every time you drive your car and approach an
intersection?
a. Iteration
b. Sequence
c. Repeating
d. Selection
14.
Which
symbol is used in C++ for the logical and operator?
a. ||
b. &&
c. %
d. @
15.
Which
type of structure do all programs use?
a. Sequence
b. Selection
c. Repetition
d. Variable
16.
Which
two c++ statement can be used to code pretest loops
a. For, while
b. If, while
c. Switch, if
d. For, switch
17.
A
common error made when writing selection structures is to reverse the decisions
made by the outer and nested structures.
a. True
b. False
18.
You
need to consider all information when analyzing a problem, even if it is unnecessary
to the solution.
a) True
b) False
19.
The
repeating structure has a true path and a false path.
a. True
b. False
20.
Comparison
operators are used to compare two values with differing data types.
a. True
b. False
21.
When
naming a memory location in c++, names are not case sensitive.
a. True
b. False
22.
The
data type of the value in a case clause within a switch statement must be
compatible with the data type of which of the following?
a. Else clause
b. SelectorExpression
c. If statement
d. DefaultExpression
23.
By
default in c++, smaller real numbers with a decimal place( those containing six
or fewer digits to the left of the decimal) are displayed in exponential
notation.
a. True
b. False
24.
The
value 29 is considered a double.
a. True
b. False
25.
The
reason why high-level languages were a vast improvement over machin e language
and assemble languages is because they allow the programmer to use instructions
that more closely resemble the English language.
a. True
b. False
26.
In
a computer program, which type of logic structure directs the computer to
process the program instructions one after another, in the order listed in the
program?
a. Variable
b. Repetition
c. Selection
d. Sequence
27.
There
are two digits in the machine language.
a. True
b. False
28.
In
a pseudocode algorithm, what part of language should each instruction begin
with?
a. Article
b. Verb
c. Adverb
d. Noun
29.
In
a repeating structure, what is the requirement for repeating instruction
called?
a. Infinite loop
b. Sentinel value
c. Looping condition
d. Exit condition
30.
Explicit
type conversion is accomplished in c++ with which of the following operators?
a. Convert
b. Static-cast
c. Type-cast
d. Explicit
31.
In
for statement, which argument or arguments are required?
a. Initialization
b. Initialization and update
c. Initialization and condition
d. condition
32.
Identifiers
can have space.
a. True
b. False
33.
if
the value’s data type does not match the memory location’s data type, what
process does the computer use to convert the value to fit the memory location?
a. truncation
b. implicit type conversion
c. rounding
d. explicit type conversion
34.
Float
and double are related to …. data type.
a. void
b. integral
c. fixed
d. floating
35.
If
the default clause is the last clause in a switch statement, what statement is required
after the default clause?
a. a case statement
b. an exit statement
c. no statement is required
d. a break statement
36.
In
a pretest loop, what initializes the loop condition by providing its first
value?
a. update read
b.
none of the above
c. sentinel value
d.
priming read
37.
floats
and double perform the same function.
a. true
b. false
38.
In
a pretest loop , what should you include to ensure that there is way to enter
the sentinel value after the loop body instructions are process the first time?
a. priming read
b.
update read
c. trip value
d. trailer value
39.
If
there is not default clause in a switch statement and no match is found, what
happens ?
a. the program execution is terminated
b. an error code is generated
c. the program loops to the beginning of
the switch statement
d. the instruction after the
closing brace is executed
40.
Float
precision is larger than double.
a. true
b. false
Total Comments: 0