Online Computer Science Test - Object Oriented Programming Test 2

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.
A function that changes the state of the cout object is called a(n) _____
member
adjuster
manipulator
operator
Your Answer: Option
(Not Answered)
Correct Answer: Option

2.
A fundamental type such as int or double is a _____
programmer-defined type
complex type
nonscalar type
scalar type
Your Answer: Option
(Not Answered)
Correct Answer: Option

3.
In a simple 'if' statement with no 'else'. What happens if the condition following the 'if is false?
the program searches for the last else in the program
nothing
control 'falls through' to the statement following 'if
the body of the statement is executed
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

4.
Code that has already been tested is said to be _____
inherited
reusable
reliable
polymorphic
Your Answer: Option
(Not Answered)
Correct Answer: Option

5.
One way pointers are useful is to refer to a memory address that has no _____
name
constant
location
field
Your Answer: Option
(Not Answered)
Correct Answer: Option

6.
The while loop is referred to as a(n) _____ loop because the loop condition is tested at the beginning of the loop
beginning
initial
pretest
priming
Your Answer: Option
(Not Answered)
Correct Answer: Option

7.
A group of related fields that contain all of the data about a specific person, place, or thing is called a
data file
field file
program file
record
Your Answer: Option
(Not Answered)
Correct Answer: Option

8.
Simple routines that programmers use as place holders while a system is being tested are called _____
stubs
stumps
holders
templates
Your Answer: Option
(Not Answered)
Correct Answer: Option

9.
Which is true?
Sequential cohesion is slightly weaker than functional cohesion
Sequential cohesion is slightly stronger than functional cohesion
Sequential cohesion is much stronger than functional cohesion
Neither sequential cohesion nor functional cohesion is stronger than the other
Your Answer: Option
(Not Answered)
Correct Answer: Option

10.
One of the relational operators in the C language is
!=
&&
!
#
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

11.
In C++, class definitions are most often
stored with each program that uses them
stored in a header file that is included in the programs that use them
stored in a folder that you paste into every new project
retyped for every new project
Your Answer: Option
(Not Answered)
Correct Answer: Option

12.
A function argument is
a variable in the function that receives a value from the calling program
a way that functions resist accepting the calling program's values
a value sent to the function by the calling program
a value returned by the function to the calling program
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

13.
Which of the following are valid characters for a numeric literal constant?
a decimal point
the letter e
a minus sign
a plus sign
All of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

14.
3 is a _____ constant
character literal
named literal
numeric literal
string literal
Your Answer: Option
(Not Answered)
Correct Answer: Option

15.
Two access specifers in C++ are
public and private
int and double
formal and informal
void and free
Your Answer: Option
(Not Answered)
Correct Answer: Option

16.
A measure of the strength of the connection between two functions is
cohesion
coupling
dependence
subjection
Your Answer: Option
(Not Answered)
Correct Answer: Option

17.
Hiding individual components of an entry is _____
polymorphism
encapsulation
scaling
not recommended in C++
Your Answer: Option
(Not Answered)
Correct Answer: Option

18.
Which of the following statements opens a file named temp.dat for output?
outFile.open("temp .dat");
fileOut.output("temp .dat");
openFile.out("temp .dat");
fileOpen.out("temp .dat");
out.fileOpen("temp .dat");
Your Answer: Option
(Not Answered)
Correct Answer: Option

19.
The delete operator returns ______ to the operating system
memory that is no longer needed
void
recycle bin
None of the above
Your Answer: Option
(Not Answered)
Correct Answer: Option

20.
The standard output stream, which refers to the computer screen, is called
cin
cout
stin
stout
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: