100% found this document useful (1 vote)
2K views14 pages

CS304 Mcqs MidTerm by Vu Topper RM-New

Uploaded by

Yasir Ejaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views14 pages

CS304 Mcqs MidTerm by Vu Topper RM-New

Uploaded by

Yasir Ejaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

CS-304 Object Oriented Programming

Update MCQS For Mid Term


Solve By Vu Topper RM
85% To 100% Marks

For More Help Contact What’s app 03224021365


Question No:1 (Marks:1) Vu-Topper RM
Which of the following best describes relationship between Book and
BookChapter classes?
A. Association
B. Inheritance
C. Aggregation
D. Composition

Question No:2 (Marks:1) Vu-Topper RM


The keyword "friend" should be placed in ___________ :
A. Main Function
B. Function Definition
C. Anywhere in program
D. Function Declaration Google

Question No:3 (Marks:1) Vu-Topper RM


Which of the following stores the address of a variable?
A. Pointer
B. Function
C. Destructor
D. Constructor

Question No:4 (Marks:1) Vu-Topper RM


_____ is creating objects of one class inside another class.
A. Association
B. Inheritance
C. Aggregation
D. Composition Page 125

For More Help Contact What’s app 03224021365


Question No:5 (Marks:1) Vu-Topper RM
Which of the following can be used as an alternative to static members?
A. Local Variables
B. Array of Objects
C. Global Variables
D. Constant Variables

Question No:6 (Marks:1) Vu-Topper RM


What is the general syntax of overloading Unary Operator as member
function of the class?
A. TYPE & operator OP ();
B. TYPE & operator OP (int);
C. TYPE & operator OP (TYPE &);
D. TYPE & operator OP (TYPE &, TYPE &);

Question No:7 (Marks:1) Vu-Topper RM


Which of the following operators operate on one operand?
A. Unary Operators
B. Ternary Operator
C. Binary Operators
D. All of the given options

Question No:8 (Marks:1) Vu-Topper RM


Composition is __________ and aggregation is ____________
relationship.
A. Weak, Weak
B. Weak, Strong
C. Strong, Weak
D. Strong, Strong

For More Help Contact What’s app 03224021365


Question No:9 (Marks:1) Vu-Topper RM
Which of the following function declaration is correct to overload the +
operator as member function in Complex class?
A. Complex +(const Complex & rhs);
B. operator + Complex (const Complex & rhs);
C. Complex operator +(const Complex & rhs);
D. Complex operator + ::(const Complex & rhs);

Question No:10 (Marks:1) Vu-Topper RM


Insertion operator is ________________ associative.
A. Left to Left
B. Right to Left
C. Left to Right Page 160
D. Right to Right

Question No:11 (Marks:1) Vu-Topper RM


Which of the following statement is TRUE about a class's Static
Member Function?
A. It can access non-static data members.
B. It is used to access static data members only.
C. It can only be called by a particular object of class.
D. It can access constant data members of the class.

Question No:12 (Marks:1) Vu-Topper RM


Which of the following is the correct way of declaring a constant
variable named RollNo?
A. const RollNo;
B. int const rollNo;
C. int RollNo const;
D. const int RollNo;

For More Help Contact What’s app 03224021365


Question No:13 (Marks:1) Vu-Topper RM
Which of the following is defined as stream extraction operator in C++?
A. *<
B. <<
C. *>
D. >> Page 158

Question No:14 (Marks:1) Vu-Topper RM


What will be the output of the following code?
#include<iostream>
using namespace std;
int main()
{
int const x = 10;cout << ++x;}
A. 10
B. Run Time Error
C. 11
D. Compile time Error

Question No:15 (Marks:1) Vu-Topper RM


In C++, the subscript operator [] must be overloaded as a _______ of the
class, with one parameter of _______ type.
A. Member function, int Google
B. Member function, char
C. Non-member function, int
D. Non-member function, char

Question No:16 (Marks:1) Vu-Topper RM


We can get the address of a variable stored in a pointer using
__________:
A. :symbol
B. :: symbol

For More Help Contact What’s app 03224021365


C. ->symbol
D. & symbol Google

Question No:17 (Marks:1) Vu-Topper RM


Suppose "int a;" is a static data member of a class named test. Which of
the following is the correct way of initializing the static variable outside
the class test?
A. test a = 0;
B. int test::a = 0;
C. int test->a = 0;

Question No:18 (Marks:1) Vu-Topper RM


___________ Operator is used to create objects at run time.
A. New Page 118
B. Create
C. Dynamic
D. Subscript

Question No:19 (Marks:1) Vu-Topper RM


Which of the following statement is NOT true about static variable of a
class?
A. They are created even when there is no object of a class.
B. Static variable belongs to a particular instance of a class.
C. Static variable is initialized once only throughout the program.
D. They remain in memory even when all Objects of a class are
destroyed.

Question No:20 (Marks:1) Vu-Topper RM


Static Data Members can be accessed through _________.
A. Semi colon
B. Dot operator
C. Scope resolution operator

For More Help Contact What’s app 03224021365


D. Dot operator and scope resolution operator

Question No:21 (Marks:1) Vu-Topper RM


Suppose we have a class named “Student”; which of the following
statement is correctly declaring the pointer to the object for “Student”
class?
A. Student obj;
B. Student &obj;
C. Student *obj;
D. *Student obj;

Question No:22 (Marks:1) Vu-Topper RM


Which of the following is the correct syntax of declaring static variable
“count” of type int?
A. int static count;
B. int count static;
C. static count int;
D. static int count;

Question No:23 (Marks:1) Vu-Topper RM


In composition ____________ are called from composing objects to
composed objects.
A. Pointers
B. Destructors Page 131
C. Constructors
D. Member Functions

Question No:24 (Marks:1) Vu-Topper RM


In C++, Composition is a relationship between ____________ and
_______________ objects.
A. Whole, part
B. Parent, child

For More Help Contact What’s app 03224021365


C. Base, derived
D. All given options are correct.

Question No:25 (Marks:1) Vu-Topper RM


In which of the following OOP paradigm objects cannot exist
independently?
A. Aggregation
B. Inheritance
C. Composition
D. Polymorphism Page 56

Question No:26 (Marks:1) Vu-Topper RM


_______ remain in memory even when all objects of a class have been
destroyed.
A. Primitive Variables
B. Static Data Members Page 114
C. Constant Data Members
D. Instance Data Members

Question No:27 (Marks:1) Vu-Topper RM


We can access a private static data member of a class through
_________________.
A. Static data member Google
B. Global data member
C. Static member function
D. Global member function

Question No:28 (Marks:1) Vu-Topper RM


Copy constructor is called when:
A. An object is deleted.
B. An object is created.
C. An array of objects is created.

For More Help Contact What’s app 03224021365


D. An object is created in term of pre existing object.

Question No:29 (Marks:1) Vu-Topper RM


In expression b = c / d , the arity of division (/) operator is ________:
A. 1
B. 4
C. 2
D. 3

Question No:30 (Marks:1) Vu-Topper RM


If you do not initialize static data member of a class of int type, it is
automatically initialized with _________.
A. 0
B. 1
C. Null
D. -32767

Question No:31 (Marks:1) Vu-Topper RM


In composition ____________ are called from composed objects to
composing objects.
A. Pointers
B. Variables
C. Destructors
D. Constructors Page 130

Question No:32 (Marks:1) Vu-Topper RM


In C++, which of the following is defined as stream insertion operator?
A. *<
B. << Page 158
C. *>
D. >>

For More Help Contact What’s app 03224021365


Question No:33 (Marks:1) Vu-Topper RM
Which of the following is an example of unary operator?
A. Division Operator ( / )
B. Equality Operator ( = =)
C. Inequality Operator ( != )
D. Increment Operator ( ++ )

Question No:34 (Marks:1) Vu-Topper RM


Which of the following issue(s) can be caused by the use of friend
functions?
A. All of the given
B. Tough debugging
C. Data vulnerability
D. Programming bugs

Question No:35 (Marks:1) Vu-Topper RM


Identify which of the following overloaded operator function’s
declaration is appropriate for the given call?
Rational_number_1 + 2.325
Where Rational_number_1
is an object of user defined class Rational_number.
A. operator+(double& obj);
B. None of the given choices
C. Rational_number operator+( Rational_number & obj);
D. Rational_number operator+(Rational_number &obj, double&
num);

Question No:36 (Marks:1) Vu-Topper RM


In C++, which of the following operator can only be overloaded as a
member function of the class?
A. Equality Operator: ==
B. Function Operator: ()

For More Help Contact What’s app 03224021365


C. Inequality Operator: !=
D. Stream Extraction Operator: >>

Question No:37 (Marks:1) Vu-Topper RM


In _______, Base class can’t always be replaced by the derived class.
Specialization

Question No:38 (Marks:1) Vu-Topper RM


A class can have only ___________ destructor(s).
One

Question No:39 (Marks:1) Vu-Topper RM


Which of the following keyword tells the compiler to substitute the code
within the function definition for every instance of a function call?
Inline

Question No:40 (Marks:1) Vu-Topper RM


In OOP, we can achieve reusability through __________.
Inheritance

Question No:41 (Marks:1) Vu-Topper RM


Through interface we represent object's_________________.
Behaviour

Question No:42 (Marks:1) Vu-Topper RM


How many objects of a given class may be constructed in an
application?
As many as the application asks for

Question No:43 (Marks:1) Vu-Topper RM


The process of extracting common characteristics from two or more
classes and combining them into a superclass is called ___________.

For More Help Contact What’s app 03224021365


Generalization

Question No:44 (Marks:1) Vu-Topper RM


“Student registers Course and Teacher teaches the Course.” is an
example of ____________.
Binary Association

Question No:45 (Marks:1) Vu-Topper RM


Which of the following concept is more close to encapsulation?
Information Hiding

Question No:46 (Marks:1) Vu-Topper RM


Aggregation between objects shows that____________
Objects have weak relationship

Question No:47 (Marks:1) Vu-Topper RM


Identify the abstract class from the given statement: "Vehicle class is
base class. Bus, Car, and Truck are derived classes."
Vehicle

Question No:48 (Marks:1) Vu-Topper RM


An instance of user defined type is called______.
Object

Question No:49 (Marks:1) Vu-Topper RM


Enclosing all the characteristics of an object within the object itself is
described as __________.
Encapsulation

Question No:50 (Marks:1) Vu-Topper RM


Which of the following is a strong relationship?
Inheritance

For More Help Contact What’s app 03224021365


Question No:51 (Marks:1) Vu-Topper RM
Composition is a strong relationship because
______________________.
compose object cannot exist independently

Question No:52 (Marks:1) Vu-Topper RM


Which of the following is NOT an access specifier in C++?
Hidden

Question No:53 (Marks:1) Vu-Topper RM


How can we identify classes from a given problem statement?
By extracting Nouns from problem statement

Question No:54 (Marks:1) Vu-Topper RM


If class B inherits from class A then it contains all characteristics of
__________.
Class A

Question No:55 (Marks:1) Vu-Topper RM


Which of the following represents the two-way association?
Employee works for the company.

Question No:56 (Marks:1) Vu-Topper RM


Constructor without any parameter is called ____________________.
Default constructor

Question No:57 (Marks:1) Vu-Topper RM


All objects of same class has _______________ attributes.
Same

For More Help Contact What’s app 03224021365


Question No:58 (Marks:1) Vu-Topper RM
Mermaid is an example of _________.
Single inheritance

Visit My YouTube Channel


For More Important Notes
Channel Name = #VuTopperRM

For More Help Contact What’s app 03224021365

You might also like