0

OOPS

Description: Provides very good knowledge on Computer science - object oriented programming
Number of Questions: 15
Created by:
Tags: Computer science object oriented programming exam test entrance information technology Computer Basics
Attempted 0/15 Correct 0 Score 0

To use either an input or output file, the program must include which header file?

  1. ifstream.h

  2. ofstream.h

  3. iostream.h

  4. fstream.h

  5. stringstream.h


Correct Option: D
Explanation:

An input/output stream that wraps a file stream buffer, provides functions to open or close a file in addition to those of generic input/output stream

To enter a comment in a C++ program, one should begin the comment with

  1. ?

  2. //

  3. a number sign (#)

  4. an asterisk (*)

  5. &&


Correct Option: B
Explanation:

The double-slash , which will be referred to as a C++-style comment, tells the compiler to ignore everything that follows this comment, until the end of the line.

Which of the following is the best form of coupling?

  1. Data coupling

  2. Tight coupling

  3. Loose coupling

  4. Common coupling

  5. Content coupling


Correct Option: C
Explanation:

Tight coupling (or tightly coupled) is a type of coupling that describes a system in which hardware and software are not only linked together, but are also dependent upon each other.

The detailed instructions that are given in a step by step manner to solve a problem are called

  1. an algorithm

  2. a list

  3. an array

  4. a data structure

  5. a class


Correct Option: A
Explanation:

An algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing and automated reasoning.

In which process will the attention be paid to the essential properties while negligible details are ignored?

  1. Modular programming

  2. Reusability

  3. Polymorphism

  4. Recursion

  5. Abstraction


Correct Option: E
Explanation:

Abstraction is the process by which data and programs are defined with a representation similar in form to its meaning (semantics), while hiding away the implementation details.

To expose a data member to the program, it must be declared in which section of the class?

  1. Common

  2. Protected

  3. Public

  4. User

  5. Private


Correct Option: C
Explanation:

A member (either data member or member function) declared in a public section of a class can be accessed by anyone.

Whenever an object is destroyed which function will be invoked automatically?

  1. Constructor

  2. Allocator

  3. Destructor

  4. Manipulator

  5. Compiler


Correct Option: C
Explanation:

Destructors are usually used to deallocate memory and do other cleanup for a class object and its class members when the object is destroyed.

Which of the following terms best suits the overloaded constructors that cannot be differentiated by a compiler?

  1. Ambiguous

  2. Overloaded

  3. Constructor

  4. Destructor

  5. Allocator


Correct Option: A
Explanation:

Access to a base class member is ambiguous if one uses a name or qualified name that does not refer to a unique function or object.

Which of the following will be used by a computer program to execute machine code, store and retrieve data?

  1. Subscript

  2. Formal parameter

  3. Actual parameter

  4. Prototype

  5. Memory address


Correct Option: E
Explanation:

Memory address is a data concept used at various levels by software and hardware to access the computer's primary storage memory.

Which type of function can be used to change the cout object's state?

  1. Member

  2. Manipulator

  3. Allocator

  4. Operator

  5. Constructor


Correct Option: B
Explanation:

Manipulators are objects that can modify a stream using the << or >> operators.

What is the other name used for a base class?

  1. Child class

  2. Subclass

  3. Derived class

  4. Parent class

  5. Array class


Correct Option: D
Explanation:

A parent class is the closest class that we derive to create the one we are referencing as the child class.

Which of the following will be adjoined to the end of a string literal constant by C++?

  1. Conditional operator ( ? )

  2. A number sign (#)

  3. An asterisk (*)

  4. A null character

  5. Comma operator (,)


Correct Option: D
Explanation:

The null character (also null terminator), abbreviated NUL, is a control character with the value zero.

Which of the following gets supported by the most computer programming languages by allowing a function to call itself within the program text?

  1. Modular programming

  2. Reusability

  3. Polymorphism

  4. Recursion

  5. Abstraction


Correct Option: D
Explanation:

It is a method where the solution to a problem depends on solutions to smaller instances of the same problem.

In common speech a file is referred as a class, wherein the file is

  1. a member function

  2. a class

  3. an operator

  4. a data item

  5. an object


Correct Option: E
Explanation:

An object is a location in memory having a value and referenced by an identifier. An object can be a variable, function, or data structure.

Immutable objects must be initialized in a

  1. member function

  2. manipulator

  3. allocator

  4. operator

  5. constructor


Correct Option: C
Explanation:

Allocators are important components of the C++ Standard Library. The standard library provides several data structures, such as list and set, commonly referred to as containers.

- Hide questions