CS304(P)-Sample Paper.docx

Verified academic study resource for CS304 (Object Oriented Programming) under the Computer Science at Virtual University of Pakistan. This DOC document (Mega Solved MCQs Question Bank) covers Full Course Curriculum spanning approximately 180 pages across 8 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
DOC
Type
MCQ Bank
Coverage
Full Course Curriculum

Cross-verify solutions against official lecture handouts. Practice active recall before checking answers to ensure true concept retention.

What this file covers — CS304 syllabus roadmap

  1. Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
  2. Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
  3. Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
  4. Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
  5. Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
  6. Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
  7. Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
  8. 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(P)-Sample Paper.docx for free?

You can preview and download "CS304(P)-Sample Paper.docx" (CS304 DOC, ~180 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs304-p-sample-paper-docx) with 100% free high-speed downloads and zero registration requirements.

What syllabus chapters and lectures are covered in this CS304 file?

This document covers Full Course Curriculum across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, 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

Sample Paper
 FINAL TERM  EXAMINATION
Fall 2022
CS304(P) - Object Oriented Programming(Practical)
Time: 90 min
Marks: 40

Question No: 1  	(Marks: 01) - Please choose the correct option
What is the keyword used in templates in C++?

A. class
B. typename
C. both class & typename (Correct)
D. function
Question No: 2
What is the purpose of using the "::" template-template parameter in C++?

A. Binding
B. Rebinding
C. Both binding & rebinding (Correct)
D. Reusing
Question No: 3
What does not require instantiation in C++?

A. Functions
B. Non-virtual member function
C. Member class
D. All of the mentioned (Correct)

Question No: 4
What is the keyword used to define user-defined data types in C++?

A. def
B. union
C. typedef (Correct)
D. type

Question No: 5

What is the scope of data types defined with typedef in C++?

A. Inside that block only
B. Whole program (Correct)
C. Outside the program
D. Main function

Question No: 6

What is a template in C++?

A. A formula for creating a generic class (Correct)
B. A tool for manipulating a class
C. A way of creating attributes
D. None of the given

Question No: 7

What is used for generic programming in C++?

A. Modules
B. Templates (Correct)
C. Virtual functions
D. Abstract Classes

Question No: 8

What can be passed by non-type template parameters at compile time in C++?

A. int
B. float
C. Constant expression (Correct)
D. char

Question No: 9

Function template in C++  is a way of creating a function___________.

A. without a class
B. with an exact type
C. without blank spaces
D. without specifying the exact type (Correct)

Question No: 10

Which of the following is not an advantage of using Templates in C++?

A. High Reliability  (Correct)
B. Reusability
C. Writability
D. Generic Programming

Question No: 11

Which one of the following is not a type of inheritance in C++?
A. public
B. virtual (Correct)
C. private
D. protected

Question No: 12

In C++ inheritance, is it possible for a child class to initialize its indirect base classes through its       constructor initialization list?
A. Yes, it is possible
B. No, it is not possible (Correct)
C. It depends on the implementation.
D. Only if the indirect base classes are direct base classes of the child class.

Question No: 13

How many classes are required to implement the multiple inheritance in a program?
A. Only two
B. At least two
C. At least three (Correct)
D. Only four

Question No: 14

 _____________ is used to solve multiple inheritance issues.
    A. Virtual inheritance (Correct)
    B. Friend functions
    C. Generic programming.
    D. Templates
Question No: 15

What is multiple inheritance in Object-Oriented (OO) programming?

A. a derived class inherits from multiple base classes. (Correct)
B. a base class inherits from multiple derived classes.
C. a class inherits from a single base class.
D. a class cannot inherit from any base class.

Question No: 16

A/an __________ is a template definition of methods and variables of a class and its object cannot be instantiated.
    A. virtual class
    B. static class
    C. concrete class
    D. abstract class(Correct)

Question No: 17

Specialization (Restriction) can be implemented using both ______ and ___________ inheritance.
    A. Public, Protected
    B. Private Protected (Correct)
    C. Virtual, Protected
    D. Public, Virtual

Question No: 18

Correct format to declare a template function is _______________.
    A. template< class T >
void funName( T x );  (Correct)

    B. template< classfunction T >
void funName( T x );

    C. template< Function T >
void funName( T x );

    D. template< class T function F>
void funName( T x );

Question No: 19

The target function for a call is selected at run-time is known as_____________.
A. Dynamic binding  (Correct)
B. Static binding
C. Function binding
D. Object binding

Question No: 20

A mechanism that enables us to write a single function or class that works for all data types is known as _________.

    A. Generic programming (Correct)
    B. Imperative programming
    C. Functional programming
    D. Logic programming

Question No: 21

What is the purpose of using a cursor pointer declared outside an aggregate object?

    A. Traverse elements (Correct)
    B. Store fixed value
    C. Store multiple values
    D. Store address

Question No: 22

Which of the following is not a method to traverse the element in a cursor?
    A. T* first()
    B. T* beyond()
    C. T* next( T* )
    D. T* prev(T*) (Correct)

Question No: 23

Cursor works fine when we have _______ memory.
    A. Contagious (Correct)
    B. Non-contagious
    C. Static
    D. Dynamic

Question No: 24

Which of the following is not a key component of STL (Standard Template Library)?
    A. Containers
    B. Iterators
    C. Algorithms
    D. Map (Correct)

Question No: 25  	(Marks: 05)

 Consider the following code named "Circle", you are required to write the following methods for the Radius class.
            a.                     One Parameter Constructor
b.                    Setter and Getter
class Circle{
      private:
float radius;
      public:
….
};

Answer

class Circle{
  	private:
float radius;
  	public:
            	Circle(float r){
                            	Radius = r;
}
            	void setRadius(float r){
                            	radius = r;
            	}
            	float getRadius(){
                            	return radius;
            	}
};
Question No: 26 	(Marks: 05)

What will be the output of the following C++ Code?
#include <cstring>
#include <cstdlib>
#include <iostream>
using namespace std;
template< typename T >
bool isEqual( T x, T y ) {
return ( x == y );
}
template< >
bool isEqual< const char* >(
const char* x, const char* y ) {
return ( strcmp( x, y ) == 0 );
}
int main (){
cout<<isEqual( 5, 6 )<<"\n";
cout<<isEqual( 7.5, 7.5 )<<"\n";
cout<<isEqual( "abc", "aba" )<<"\n";
system("PAUSE");
return EXIT_SUCCESS;
}
Answer
0
1
0

Question No: 27  	(Marks: 05)

Considering the following code, make changes in such a way that the compiler will initialize the data members in the following order: b, c, a,
class A{
private:

More CS304 files

All CS304 files · Midterm Prep 2026 · MCQs Bank