Online Computer Science Test - Object Oriented Programming Test 3

Instruction:

  • This is a FREE online test. Beware of scammers who ask for money to attend this test.
  • Total number of questions: 20.
  • Time allotted: 30 minutes.
  • Each question carries 1 mark; there are no negative marks.
  • DO NOT refresh the page.
  • All the best!

Marks : 2/20


Total number of questions
20
Number of answered questions
0
Number of unanswered questions
20
Test Review : View answers and explanation for this test.

1.
Evaluate the following expression: 3 >6&&7>4
True
False
Your Answer: Option
(Not Answered)
Correct Answer: Option

2.
A normal C++ operator that acts in special ways on newly defined data types is said to be
glorified
encapsulated
classified
overloaded
Your Answer: Option
(Not Answered)
Correct Answer: Option

3.
Functions that returns information about an object's state can be classified as ________
inspector functions
mutator functions
auxiliary functions
manager functions
Your Answer: Option
(Not Answered)
Correct Answer: Option

4.
If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as
static
unary
dynamic
volatile
Your Answer: Option
(Not Answered)
Correct Answer: Option

5.
Using new may result in less _____ memory than using an array
wasted
used
RAM
ROM
Your Answer: Option
(Not Answered)
Correct Answer: Option

6.
Which of the following is a C++ class?
>>
read()
cin
iostream
Your Answer: Option
(Not Answered)
Correct Answer: Option

7.
Which of the following, if any, are invalid names for a variable?
bankAccountNumber
first_Name
doubleNumber
operator
All of the above are valid names for variables
Your Answer: Option
(Not Answered)
Correct Answer: Option

8.
To create a template class, you begin with _________
the template definition
the keyword class
the function definitions
the keyword definition
Your Answer: Option
(Not Answered)
Correct Answer: Option

9.
An exception specification begins with the keyword _____
exception
try
throw
catch
Your Answer: Option
(Not Answered)
Correct Answer: Option

10.
In C++, the address operator is the following symbol _____
>>
&
*
!
Your Answer: Option
(Not Answered)
Correct Answer: Option

11.
Which of the following is true?
iostream is derived from istream
iostream is derived from ostream
ostream is derived from iostream
ostream is derived from istream
Your Answer: Option
(Not Answered)
Correct Answer: Option

12.
In the C language, the character type of constant is delimited by using
single quotes
double quotes
parenthesis
#
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

13.
One of the logical operators in the C language is represented by the symbol
AND
&&
>=
<=
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

14.
Which is true?
Coincidental cohesion is stronger than procedural cohesion
Logical cohesion is stronger than coincidental cohesion
Sequential cohesion is weaker than temporal cohesion
The weakest cohesion is functional
Your Answer: Option
(Not Answered)
Correct Answer: Option

15.
A pointer is
the address of a variable
an indication of the variable to be accessed next
a variable for storing addresses
the data type of an address variable
Your Answer: Option
(Not Answered)
Correct Answer: Option

16.
Programmers prefer to declare almost all variables _____
at the beginning of each function
globally
on one line
with cryptic names
Your Answer: Option
(Not Answered)
Correct Answer: Option

17.
A function's single most important role is to
give a name to a block of code
reduce program size
accept arguments and provide a return value
help organize a program into conceptual units
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

18.
The main difference in operation between an 'if statement and a 'while' statement is
the 'while' loop body is executed
the body of the 'while' statement may be executed many times, the body of the 'if statements only once
the conditional expression following the keyboard is evaluated differently
All of the above
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

19.
The 'break' statement is used to exist from
a do loop
a for loop
a switch statement
All of the above
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

20.
Which of the following creates a String named constant called partNo, whose value is AB45?
const char[4] partNo = "AB45";
const char[5] partNo = 'AB45';
const char[5] partNo = "AB45";
const char partNo[5] = "AB45";
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

*** END OF THE TEST ***
Time Left: 00:29:56
Post your test result / feedback here: