MID-TERM GRAND QUIZ
FALL 2020 (Paper 1)
Question No 1:
If class B (Raise For Success) inherits from class A. Which of the following is child class?
- Class B Correct
- Class A
- Both Class A & Class B
- No child class
Question No 2:In expression (Raise For Success) c1*c2+c3-c4 which of the following will be executed in first order?- c1*c2 Correct
- c2+c3
- c3-c4
- c1-c4
- c1*c2 Correct
- c2+c3
- c3-c4
- c1-c4
Question No 3:________ means (Raise For Success) that different objects can between in different ways for the same message.- Specialization
- Generalization
- Polymorphism Correct
- Abstraction
- Specialization
- Generalization
- Polymorphism Correct
- Abstraction
Question No 4:In expression (Raise For Success) b = c/d. The arity of division (/) operator is _______.- 1 Correct
- 2
- 3
- 4
- 1 Correct
- 2
- 3
- 4
Question No 5:If our class (Raise For Success) involves dynamic memory and we do not write Deep copy constructor for this class. _______ problem (s) can occur.- System may crash
- Memory leakage
- Dangling pointer
- All of the given Correct
- System may crash
- Memory leakage
- Dangling pointer
- All of the given Correct
Question No 6:Composition is a (Raise For Success) strong relationship because- Composed object can't exist independently. Correct
- Composed object's relationship depends on the number of objects.
- Composed objects can exist independently.
- Composed objects are dependent on the relation type.
- Composed object can't exist independently. Correct
- Composed object's relationship depends on the number of objects.
- Composed objects can exist independently.
- Composed objects are dependent on the relation type.
Question No 7:Which of the (Raise For Success) following best describes relationship between Book and Book Chapter classes?- Aggregation Correct
- Composition
- Association
- Inheritance
- Aggregation Correct
- Composition
- Association
- Inheritance
Question No 8:Member function (Raise For Success) for a class student can be.- void setName(char *newName).
- void setRollNo(int newRollNo).
- void setCGPA(float newCGPA).
- All of the given options. Correct
- void setName(char *newName).
- void setRollNo(int newRollNo).
- void setCGPA(float newCGPA).
- All of the given options. Correct
Question No 9:Enclosing all the (Raise For Success) characteristics of an object itself is described as ______.- Encapsulation Correct
- Data Hiding
- Information Hiding
- Inheritance
- Encapsulation Correct
- Data Hiding
- Information Hiding
- Inheritance
Question No 10:Choose correct (Raise For Success) declaration of overload '*=' operator for class Complex as member function.- Complex & operator*=():
- Complex & operator*=(const Complex & C):
- Complex & operator*=(const Complex & C1, const Complex & C2):
- None of the given options Correct
- Complex & operator*=():
- Complex & operator*=(const Complex & C):
- Complex & operator*=(const Complex & C1, const Complex & C2):
- None of the given options Correct
Question No 11:A good model (Raise For Success) is ______ related to a real life problem.- Loosely
- Openly
- Closely Correct
- Not
- Loosely
- Openly
- Closely Correct
- Not
Question No 12:Which of the (Raise For Success) following concept is more close to encapsulation?- Exception Handling
- Inheritance
- Polymorphism Correct
- Information Hiding
- Exception Handling
- Inheritance
- Polymorphism Correct
- Information Hiding
Question No 13:In class, attributes (Raise For Success) and behaviors are represented by ______ and ______ respectively.- Member functions, data members
- Member functions, scope of data members
- Data members, member functions Correct
- None of the given
- Member functions, data members
- Member functions, scope of data members
- Data members, member functions Correct
- None of the given
Question No 14:In which of the (Raise For Success) following, different forms of a single entity exist?- Composition
- Aggregation
- Polymorphism Correct
- Encapsulation
- Composition
- Aggregation
- Polymorphism Correct
- Encapsulation
Question No 15:Aggregation between (Raise For Success) objects shows that _______.- Objects have strong relationship.
- Objects have weak relationship. Correct
- Objects have no relationship.
- Objects have hierarchical relationship.
- Objects have strong relationship.
- Objects have weak relationship. Correct
- Objects have no relationship.
- Objects have hierarchical relationship.
Question No 16:Student (Raise For Success) *ptr = new Student("Ali"); is an example of ________.- Static memory allocation
- Dynamic memory allocation Correct
- Destructor
- Constructor
- Static memory allocation
- Dynamic memory allocation Correct
- Destructor
- Constructor
Question No 17:Choose correct (Raise For Success) declaration of copy constructor for class person.- Copy(Person P) Correct
- Person(const Person &)
- Person(char *name)
- Person(copy P)
- Copy(Person P) Correct
- Person(const Person &)
- Person(char *name)
- Person(copy P)
Question No 18:In C++, which (Raise For Success) of the following is defined as stream insertion operator?- << Correct
- >>
- *>
- *<
- << Correct
- >>
- *>
- *<
Question No 19:Which of the (Raise For Success) following is an advantage of encapsulation?- Complexity
- Better understanding
- Reuse of the code
- Efficient code Correct
- Complexity
- Better understanding
- Reuse of the code
- Efficient code Correct
Question No 20:In which of (Raise For Success) the following way(s), we can inherit a class from another class in C++?- Private
- Public
- Protected
- All of the given options Correct
- Private
- Public
- Protected
- All of the given options Correct
Question No 21:How many (Raise For Success) objects can be created once a class is defined?- Two
- Three
- Four
- As many as needed Correct
- Two
- Three
- Four
- As many as needed Correct
Question No 22:Which of the (Raise For Success) following is most suitable advantage of information hiding?- Simplifies the model
- Reusability
- Permission to change Correct
- Increased complexity
- Simplifies the model
- Reusability
- Permission to change Correct
- Increased complexity
Question No 23:_________ associates (Raise For Success) the objects of the exact three classes.- Binary Association
- Two way Association
- Ternary Association Correct
- N-ary Association
- Binary Association
- Two way Association
- Ternary Association Correct
- N-ary Association
Question No 24:Which of the (Raise For Success) following allows to reuse characteristics of more than one parent class?- Single inheritance
- Multiple Inheritance Correct
- Polymorphism
- Specialization
- Single inheritance
- Multiple Inheritance Correct
- Polymorphism
- Specialization
Question No 25:Object Orientation (Raise For Success) approach can be achieved using objects and their _______.- Interactions
- Attributes Correct
- Models
- None
- Interactions
- Attributes Correct
- Models
- None
Question No 26:Which of the (Raise For Success) following issue(s) can be caused by the use of friend functions?- Data vulnerability
- Programming bugs
- Tough debugging
- All of the given Correct
- Data vulnerability
- Programming bugs
- Tough debugging
- All of the given Correct
Question No 27:How many (Raise For Success) interactions are there in the following scenario?Imran has the car. He drives the car and car has four wheels and doors.- 1
- 2 Correct
- 3
- 4
- 1
- 2 Correct
- 3
- 4
Question No 28:Data member(s) (Raise For Success) of a class Student can be.- int rollNo;
- char *name;
- float CGPA;
- All of the given options Correct
- int rollNo;
- char *name;
- float CGPA;
- All of the given options Correct
Question No 29:Identify which (Raise For Success) of the following overload operator function's declaration is appropriate for the given call?Rational_number_1 + 2 325Where Rational_number_1 is an object of user defined class Rational_number.- Rational_number operator+( Rational_number & obj);
- None of the given choices
- Rational_number operator+(Rational_number &obj, double& num); Correct
- operator+(double& obj);
- Rational_number operator+( Rational_number & obj);
- None of the given choices
- Rational_number operator+(Rational_number &obj, double& num); Correct
- operator+(double& obj);
Question No 30:A class can (Raise For Success) have only _______ destructor.- One Correct
- Two
- Three
- Four
- One Correct
- Two
- Three
- Four
Tags:
CS304
cs304 midterm solved papers
cs304 solved past papers
CS304-Object Oriented Programming | Mid-Term Grand Quiz Fall 2021
Fall 2022
Fall 2023
Fall 2024
Fall 2025
Raise For Success
V-Expert Services