CS304 Solved Grand Quiz Spring 2021
![CS304 Solved Grand Quiz](https://vuexamguide.com/wp-content/uploads/2023/08/CS304-Solved-Grand-Quiz.png)
Welcome to CS304 Grand Quizzes at VUExamGuide.com – your ultimate destination for 100% Correct Answers! If you are a CS304 student at VU, seeking a reliable study resource to excel in your quizzes and exams, you’ve come to the right place.
Our CS304 Grand Quizzes cover a wide range of topics, meticulously prepared by our expert team to ensure accuracy and clarity. With a focus on Object-Oriented Programming (OOP) concepts and principles, these quizzes will deepen your understanding and enhance your problem-solving skills in software development.
No more struggling with complex coding challenges or uncertain solutions! VUExamGuide.com empowers you with the tools to succeed in CS304. Embrace the knowledge and skills you need to become a proficient object-oriented programmer.
Join us now and embark on a journey of academic excellence with CS304 Grand Quizzes. Prepare to shine and propel yourself towards a brighter future – start exploring VUExamGuide.com today!
CS304 Solved MCQs
SR NO | MCQS QUESTION | ANSWER |
1 | In expression c1*c2+c3-c4 which of the following will be executed in first order | C1*c2 |
2 | Inheritance is a way to | Add features to existing classes without rewriting them |
3 | ————— represent “IS A ”relationship | Inheritance |
4 | Constructor without any parameter is called: | Default constructor |
5 | Which of the following stores the address of a variable? | Pointer |
6 | A Post-fix unary operator is implemented in C ++ using Member function with | 1 dummy int argument |
7 | minimum classes required in a program for implementing multiple inheritance | 3 |
8 | Which of the following statement(s) describe constant member functions? | All of the given option |
9 | composition is a strong relation relationship because | Composed object cant exist independency |
10 | How many interactions are there in the following scenario Imran has the car. he drive the car and car has four wheels and doors | 3 |
11 | if we extend our model ,and the rest of the model is not affected then it is called—— | Flexibility |
12 | choose correct declaration of overload*=1 operator for class complex as Member function | Complex and operator*=(const complex & c) |
13 | Consider the following class A{int a,b,c; public: A():B(10),C(0)a(7) }; | A,b,c |
14 | Class is a blue print of | Objects |
15 | Suppose we have a class student which of the following statement is correctly declaring the pointer to the object of student class? | Student*object |
16 | In c++ composition is relationship between ——-and——objects | Whole, part |
17 | Which of the following Depicts the proper definition of class? | a class is description of a kind of object |
18 | in class attributes are represented by —-and—— respectively | data member, Member function |
19 | which of the following represents the two Association | Employee works for the company |
20 | Entities in OO model are represented by | Rectangle |
21 | Which of the following features of OOP is used to derive a class from another? | Inheritance |
22 | In C ++ which of the following is defined as a stream insertion operator? | << |
23 | choose the correct declaration of overloaded equality (==)operator for class string as a Member function | Bool operator==(const string and s) |
24 | —- is the relationship between the part object and the whole object | Composition |
25 | object hides its information from others this concept is known as | information hiding |
26 | the concept of derived classes is involved in | Inheritance |
27 | abstraction provides information according to | user perspective |
28 | which of the following is not an object Association | Inheritance |
29 | which of the following classes are used by amphibious vehicle to inherit characteristics | both land and water vehicle |
29 | object data includes | both states and attributes of an object |
30 | choose correct declaration of overloaded inequality operator for class string as non member friend function | friend pool operator !=(const string &s1,const string &2) |
31 | How many objects of a given class may be constructed in an application? | as many as the application ask for |
32 | how many objects of a given class may be constructed in an application | as many as the application ask for |
33 | Which of the following statements describe constant member functions? | all of the given option |
34 | student *ptr=new student(” Ali”); is an example of | static memory allocation |
35 | in——- base class can be replaced by the derived class | extension |
36 | Which of the following is a correct way of declaring constant variable ROLLNO? | cosnst int Roll no; |
37 | which of the following operator doesn’t take argument hit overloaded | none of the given choices |
38 | which of the following is part of the Class diagram | all of the given option |
39 | a child inherits characteristic from its | parent |
40 | which of the following issues can be caused by the use of friend function | programming Bugs |
41 | which of the following is not true about constant number function | all of the given option |
42 | Which one is not the main features of object oriented programming? | exception handling |
43 | ||
44 | in object oriented programming, objects communicate with each other through | messages |
45 | static data member is declared | inside the class |
46 | the concept of derived classes is involved in | inheritance |
47 | Which of the following can we attribute of an object “Ali”? | address |
48 | Which of the following keyword tell the compiler to substitute the code within the function definition for every instance of a function call? | inline |
49 | inheritance is the relationship between | classes |
50 | how many objects are involved in the binary Association | 2 |
51 | all objects of same class has ——–attributes | same |
52 | which of the following concept is more close to encapsulation | information hiding |
53 | member initialization list is used to | initialize data member |
54 | aggregation between objects show that | objects have week relationship |
55 | there is /are ways to create user defined types for objects in C ++ | two |
56 | composition is a strong relationship because: | composed object can not exist independently |
57 | in polymorphism messenger can be interpreted in different ways depending upon the—– class | receiver |
58 | which of the following is most suitable advantage of information hiding | simplifies the model |
59 | the process of extracting common characteristics from two or More classes and combining them into a generalized superclass is called | Generalization |
60 | ——- operator is used to create objects at run time | new |
61 | choose the correct option to declare an overloaded Stream insertion operator for userdefind class “string” as a non-member friend function | friend out stream and operator<<(ostream and os,const string & s) |
62 | static data member is declared | inside the class |
63 | an instance of user defined type is called | object |
64 | which of the following is true about constructor | all of the given option |
65 | Which of the following correct way of declaring constant variable ROLLNO? | const int ROLLNO; |
66 | inheritance is shown by | filled arrow |
67 | which of the following operators operate on one operand | unary operator |
68 | which of the following will happen when a constant function tried to change the value of data members of the class | compile time error will occur |
69 | in object oriented programming, objects communicate with each other through— | messages |
70 | How the information hidden within an object can be accessed? | through its interface |
71 | object orientation approach can be achieved using object and their——- | interactions |
72 | constructors have —– return type | no |
73 | which of the following is an example of unary operator | increment operator(++) |
74 | memory is allocated to non-static members only when | object is created |
75 | in class B inherit from class A which of the following is child class | class B |
76 | the—— tells the compiler what task the function will be performing | function definition |
77 | Consider the statement” room has chair” which of the following type of Association exists between whom and chair? | aggregation |
78 | how many objects are involved in the N-ary Association | more than 3 |
79 | deconstruct is a function which has the same name as that of class but starts with a—– sign | ~ |
80 | which of the following is a tangible entity | car |
81 | member initializer list is used to | initialize data members |
82 | we can get the address of variable stored in pointer using—– | & symbol |
83 | two sentence object oriented programming book in bookshelf is an example of | aggregation |
84 | which of the following best defines the obstruction | hide the implementation and show current perspective |
85 | which of the following define default constructor 5 class student | student(){//..} |
86 | object data includes | both state and attributes of an object |
87 | minimum classes required in a program for implementing multiple inheritance | 3 |
88 | information hiding can be achieved through——- | encapsulation, abstraction |
89 | compiler generated defaulter structure is called—– hand user written default constructor is called—- | implicit, explicit |
90 | which of the following is true about constructor | all of the given option |
91 | In which of the following different forms office single entity exist? | polymorphism |
92 | data members of a class student can be: | all of the given option |
93 | the—– turn off the compiler what does the function will be performing | function definition |
94 | Suppose a class does not have any constructor what will happen when an object of this class is created? | compiler will call implicit default constructor |
95 | how can we differentiate between constructor and destructor | destructor are preceded with a Tilda(~) symbol, and constructor are not preceded with any symbol |
96 | —- is used for hiding the details of an object from the other parts of a program | encapsulation |
97 | Class diagram include | class name, attributes, operation |
98 | through interface was access objects——– | behavior |
99 | composition is a strong relationship because | compose object cannot exist independently |
100 | copy constructor is called when: | an object is created in term of Preexisting object |
101 | choose the correct option to declare an overloaded stream insertion operator for a user defined class string as a non-Member friend function | friend ostream & operator(ostream &os.const string &s) |
102 | a post-fix unary operator implemented in C plus plus using non Member function with—- arguments | two |
103 | in class attributes and behaviors are represented by—- and— respectively | data members, member functions |
104 | which of the following best describes the relationship between book and book chapter classes | composition |
105 | which of the following is true about destructor | all of the given option |
106 | in composition—– are called from composing objects to composed subjects | destructors |
107 | which of the following can be used an alternative to Static members | Global variables |
108 | which of the following statement is true about static function of a class | it is used to access static data members |
109 | which of the following operator does not take any arguments if overloaded | none of the given choices |
110 | what is the output of the following code int main(){int cost x=10;cout<<++x;return0;} | error |
111 | abstraction includes——- | relevant information |
112 | Which of the following can be the behavior of an object “Usman”? | eat |
113 | a class defined within another class is | nested class |
114 | when an object is initialized, is automatically called by the compiler | constructor |
115 | the compiler treats the Member function of a class as | inline function |
116 | an object has attributes operation ,and——- | unique identity |
117 | Which of the following is not an access specifier in C ++? | hidden |
118 | which of the following parts of an object exhibits its state | data |
119 | —- is the relationship between the part object and the whole object | composition |
120 | how can we identify classes from a given problem statement | by extracting nouns from problem statement |
121 | what “friend” should be placed in | function declaration |
122 | generalization is——– approach | bottom-up |
123 | static data members can be accessed through——– | dot operator and scope resolution operator |
124 | composition age—– and aggregation is——- relationship | strong, weak |
125 | suppose there is an object of type person, which of the following can be considered as one of its attributes | name |
126 | Which of the following depicts the proper definition of class? | a class is a description of a kind of object |
127 | a child inherits characteristics from its——- | parent |
128 | the car is composed of wheels what is the relationship between car and wheels? | composition |
129 | —— is creating objects of one class inside another class | composition |
130 | the other name of specialization is——- | restriction |
131 | suppose a is an int type static data member class test then which of the following is correct way of initialization the static variable outside the class test | int test::a=0 |
132 | Which of the following stores the address of variable? | Pointer |
133 | ||
134 | ||
135 | static data member is declared | inside the class |
136 | polymorphism makes the system | all of the given option |
137 | which of the following statement best describes the constructor | constructor is used to initialize the data members of a class |
138 | data member(s) of a class student can be | all of the given option |
139 | which of the following is a strong relationship | composition |
140 | all objects of same class has——- attributes | same |
141 | in C ++ composition is a relationship between—-and—- objects | whole, part |
142 | suppose 12 class string assignment operator is overloaded with following declaration void operator=(const string &); what will happen when we will write following statement in main() str=str2=str3;where,str1.str2,str3 are object of class string | compiler will generate compile time error |
143 | in class B inherits from class A then it contains all characteristics of—- | class A |
144 | which of the following is not an example of multiple inheritance | car |
145 | which of the following can be created without any object of a class? | static data members |
146 | consider the following code segment class test{int a;int b;int c;} | junk value,5, junk value |
147 | object orientation approach can be achieved using objects and their—– | interactions |
148 | member functions defined inside a class declaration are——- by default | private |
149 | how can we identify classes from a given problem statement | by extracting nouns from problem statement |
150 | which of the following statement is not true about static variable of a class? | static variable belongs to particular instance of a class |
151 | there are—— types of constructor in C++ | 3 |
152 | statement yasir is a friend of Ali and Ali is a friend of yasir is an example of | two way Association |
153 | this pointer cannot be passed implicitly to——– functions | static member |
154 | which of the following issues can be caused by the use of friend function | all of the given |
155 | in—— send a message does not need to know exact class of the receiver | none of the given option |
156 | minimum classes required in a program for implementing multiple inheritance | 3 |
157 | ——-Associates the object of the exact two classes | binary Association |
158 | main characteristics of information hiding is | keep the model simple |
159 | static data member is declared | inside the class |
160 | in expression b=c/d, the arity of division(/) operator is | 2 |
161 | we can allocate dynamic memory in C ++ through operator | new |
162 | Which of the following is true about accessor functions? | all of the given option |
163 | in—- base class cannot always be replaced by the derived class | specialization |
164 | abstraction help to | reduce the complexity |
165 | relationship in which child object gets destroyed if parent object is destroyed | composition |
166 | object oriented programming is better than procedural programming because: | it is more close to reality |
167 | The derived class inherits behavior from the base class and also exhibits its own behavior. this concept is known as— | Overriding |
168 | the other name of subtyping is | Extension |
169 | A good model is—— related to life problem | closely |
170 | in generalization general class represents the ——– behavior of the class | common |
171 | how can we identify from a given problem statement? | by extracting noun from problem statement |
172 | which of the following is not a access specifier in C ++ | hidden |
173 | in composition—— are called from composing objects to composed objects | destructors |
174 | a class have only—- destructor | one |
175 | suppose you have following C + + statement int old value=10; int new value=++old value; what will be the value of old value and newValue after executing above statements ? | oldVlue=11,newVlue=11 |
176 | in constant Member function the type of this pointer is | constant pointer to constant data |
177 | —– is creating objects of one class inside another class | composition |
178 | ——– Associates the objects of the exact three classes | ternary Association |
179 | generalization is implemented through | inheritance |
180 | which of the following is strong relationship | composition |
181 | composition is a strong relationship because | composed object cannot exist independently |
182 | —– is set of function of an object exposed of other objects | interface |
183 | suppose student is a class, which of the following defines constructor with one parameter for class student | student(char*aName); |
184 | which of the following is not true about constant Member function | all of the given option |
185 | —– define the order of evaluation of an operator is an expression | operator precedence |
186 | choose correct declaration of overloaded inequality(!=) operator for class string as non member friend function | friend bool operator!=(const string &s1,cont string &s2) |
187 | which of the following is most suitable advantage of information hiding | simplifies the model |
188 | a fan has wings, which type of relation exists between fan and Wings in this sentence | composition |
189 | multiple inheritance is implemented between class through—— symbol | comma(,) |
190 | postfix unary operator is implemented in C ++ using non Member function with arguments | two |
191 | Supposed derived class is inherited from base class what happens when a derived class object is created | the constructor of base class exact is executed before the constructor of derived class |
192 | assignment operator are | right associative |
193 | a postfix unary operator is implemented in C ++ using number function with | 1 dummy int argument |
194 | which of the following is true about exception functions | all of the given option |