CS304-FINALTERM-SUBJECTIVE-BY-MOAAZ.pdf
Verified academic study resource for CS304 (Object Oriented Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Final-Term Solved Past Paper & Examination Pack compiled by Moaaz Siddhu) covers Final-Term Exam Scope (Lectures 23 to 45) spanning approximately 320 pages across 4 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.
- Course
- CS304 – Object Oriented Programming
- Faculty
- Computer Science
- Format
- Type
- Final-Term
- Coverage
- Final-Term Exam Scope (Lectures 23 to 45)
- Compiled by
- Moaaz Siddhu
- Tags
- SUBJECTIVE, FINALTERM
Virtual University regulations strictly require achieving at least 20% marks in the Final-Term exam paper alone (typically 12+ marks out of 60) to pass CS304, regardless of midterm scores.
What this file covers — CS304 syllabus roadmap
- Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
- Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
- Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
- Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)
Frequently asked questions
Where can I download CS304-FINALTERM-SUBJECTIVE-BY-MOAAZ.pdf for free?
You can preview and download "CS304-FINALTERM-SUBJECTIVE-BY-MOAAZ.pdf" (CS304 PDF, ~320 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs304-finalterm-subjective-by-moaaz-pdf) with 100% free high-speed downloads and zero registration requirements.
What syllabus chapters and lectures are covered in this CS304 file?
This document covers Final-Term Exam Scope (Lectures 23 to 45) across 4 distinct lecture units (Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.
What is the passing criteria for CS304 under the VU 20% Two-Half Rule?
Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.
Are CS304 solved past papers and handouts verified for 2026 exams?
Yes. All CS304 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.
Inside this file
CS304- Object Oriented Programming
LATEST SOLVED SUBJECTIVES FEB 16,2012
FROM FINALTERM PAPERS
Mc100401285 Moaaz.pk@gmail.com mc100401285@gmail.com Subjective solved
FINALTERM EXAMINATION 2012 (FEB)
Q: 42: Write the names of two types of Templates. MARKS: 2
Answer:- (Page 256)
a. Function Templates (in case we want to write general function like printArray)
b. Class Templates (in case we want to write general class like Array class)
Q: 42: Describe the way to declare a template function as a friend of any class. 2marks
Answer:- (Page 294)
template< class T >
class B {
int data;
friend void doSomething( T ); // granting friendship to template
doSomething in // class B
friend A< T >; // granting friendship to class A in class B
};
Q: 43: Can a constructor throw an exception? How to handle the errors, when the constructor fails?
Answer:-
Yes, Constructor can throw an exception But In constructor if an exception is thrown than all objects created so
far are destroyed. Exception due to constructor of any contained object or the constructor of a parent class can
be caught in the member initialization list.
Q: 44: Why these operators can not be overloaded:
. , .* , ?: , ::
Answer:- (Page 141)
Reason: They take actual current object name, rather than value in their argument
Q: 46: What is graceful termination method of Error handling; give its example using C++.
Answer:- (Page 330)
Program can be designed in such a way that instead of abnormal termination, that causes the wastage of
resources, program performs clean up tasks, mean we add check for expected errors (using if conditions),
Example – Graceful Termination
int Quotient (int a, int b ) {
if(b == 0){
cout << “Denominator can’t “ << “ be zero” << endl;
// Do local clean up
exit(1);
}
return a / b;
}
Q: 47: How can you describe Virtual destructor? Why Virtual destructor is used?
Answer:- (Page 234)
When delete operator is applied to a base class pointer, base class destructor is called regardless of the object
type. Only base class part of object will be deleted other parts will remain as it is this result in memory leak
(wastage of memory), Virtual Destructors make it possible that complete object is being deleted so there is no
memory leak (waste of memory).
Q: 48: Motor car can be called a good candidate for being an object so, this ibject contains Encapsulation
characteristic. You are required to apply the concept of Encapsulation on “Motor Car”.
Answer:-
Yes Motor Care is a good candidate for apply the concept of encapsulation
In Motor Car we have the following Objects which fully describes the phenomena of encapsulation.
1. Steer Wheels
2. Accelerate
3. Change Gear
4. Apply Brakes
5. Turn Lights On/Off
In encapsulation we just provide the user an interface and hide the Full implementation from the user because
user don’t want to know the implementation he Just want his work should be done perfectly
For example: Breaks of car, we gave just a paddle to the User and encapsulate how it works inside the engine.
Same for accelerator, gear, steer wheels and turn on and off of Light.
Q: 49: Suppose base class and derived class has a member function with same signature. Now call that
member function through the pointers to a base class object. Now, what determines that the base class
member function or derived class function will be called?
Q: 51: What do you know about exception in initialization? Explain with example.
Answer:- (Page 345)
Exception in Initialization List
Exception due to constructor of any contained object or the constructor of a parent class can be caught in the
member initialization list.
Example
Student::Student (String aName) : name(aName)
/*The constructor of String can throw a exception*/
{
...
}
Exception in Initialization List
The programmer may want to catch the exception and perform some action to rectify
the problem
Example
Student::Student (String aName)
try : name(aName) {
...
}
catch (…) {
}
FINALTERM EXAMINATION 2012 (FEB)
1. How can we set the default values for non type parameters?
Answer:- (Page 284)
We can set default value for this non type parameters, as we do for parameters passed in ordinary functions,
template< class T, int SIZE = 10 >
class Array {
private:
T ptr[SIZE];
public:
void doSomething();
…
}
2. Explain the statement vector <int> ivec (4,3)
Answer:-
This would create a vector of four elements, each one initialized to 3. ivec looks like this:
3 3 3 3
3. Tell the procedure of making a class abstract in C++ by giving an example.
Answer:- (Page 230)
In C++, we can make a class abstract by making its function(s) pure virtual. Conversely, a class with no pure
virtual function is a concrete class (which object can be instantiated)
A class having pure virtual function(s) becomes abstract
class Shape {
…
public:
virtual void draw() = 0;
}
4. Write down a list of four intangible objects?
Answer:-
1. Time
2. Light
3. inteligence
4. Temperature
5.software
5. Give the pseudo code of non case sensitive comparison function of string class.
Answer:- (Page 263)
int caseSencompare( char* str1, char* str2 )
{
for (int i = 0; i < strlen( str1 ) && i < strlen( str2 ); ++i)
if ( str1[i] != str2[i] )
return str1[i] - str2[i];
return strlen(str1) - strlen(str2);
}
6. Describe three properties necessary a container to implement generic algorithms.
Answer:- (Page 301)
We claimed that this algorithm is generic, because it works for any aggregate object
(container) that defines following three operations
a. Increment operator (++)
b. Dereferencing operator (*)
c. Inequality operator (!=)
7. Mobile is a good entity for being an object. Write characteristics, behavior and unique ID.
Answer:-
Characteristics: Buttons, Battery, Screen
Behavior: Calling, Sending Message, Internet, Multimedia
Unique ID: Nokia
8. What are the container requirements? Write details.More CS304 files
- All Subjects Mid & Final 25000 Pdf Files.pdf (PDF · Final-Term)
- CS-304 Latest Mcq's Final Term By Vu Topper RM.pdf (PDF · Final-Term)
- CS-304 Solved Mcq's Final Term By Vu Topper RM.pdf (PDF · Final-Term)
- CS304 - Final Term Papers (www.weblyceum.com) 01.pdf (PDF · Final-Term)
- CS304 - Final Term Papers (www.weblyceum.com) 02.pdf (PDF · Final-Term)
- CS304 - Final Term Papers (www.weblyceum.com) 03.pdf (PDF · Final-Term)
- CS304 - Final Term Papers (www.weblyceum.com) 04.pdf (PDF · Final-Term)
- CS304 - Final Term Papers (www.weblyceum.com) 04.pdf (PDF · Final-Term)