CS304ObjectOrientedProgrammingMidTermNotes.pdf

Verified academic study resource for CS304 (Object Oriented Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Midterm Solved Past Paper & Revision File) covers Mid-Term Exam Scope (Lectures 1 to 22) spanning approximately 240 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
PDF
Type
Midterm
Coverage
Mid-Term Exam Scope (Lectures 1 to 22)

Focus on core definitions and repeated MCQs from Lectures 1–22. Remember that scoring in the First Half builds your safety buffer toward the mandatory 20% Two-Half passing rule in CS304.

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)

Frequently asked questions

Where can I download CS304ObjectOrientedProgrammingMidTermNotes.pdf for free?

You can preview and download "CS304ObjectOrientedProgrammingMidTermNotes.pdf" (CS304 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs304objectorientedprogrammingmidtermnotes-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 Mid-Term Exam Scope (Lectures 1 to 22) across 4 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22), 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

                                      Object Oriented Programming CS304
Lecture No 1
What is Object-Orientation?
It is a technique in which we visualize our programming problems in the form of objects and their interactions as happens in
real life.
Object orientation makes it easier for us to solve our real world problems by thinking solution of the problem in terms of real
world objects.
So we can say that in our daily life everything can be taken as an object that behaves in a certain way and has certain
attributes.
What is a Model?
A model is an abstraction of something real or conceptual. We need models to understand an aspect of reality.
Model Examples
Highway maps - Architectural models - Mechanical models
In the context of programming models are used to understand the problem before starting developing it.
Object-Orientation - Advantages
As Object Oriented Models map directly to reality
We can easily develop an object oriented model for a problem. Everyone can easily understand an object oriented model. We
can easily implement an object oriented model for a problem using any object oriented language like c++ using its features1 like
classes, inheritance, virtual functions and so on…
What is an Object?
An object is,                                                        An object has,
1. Something tangible (Ali, School, House, Car).                     1. State (attributes)
2. Something conceptual (that can be apprehended                     2. Well-defined behavior (operations)
intellectually for example time, date and so on…).                   3. Unique identity
Lecture No 2
Information Hiding:
Information hiding is one of the most important principles of OOP inspired from real life which says that all information should
not be accessible to all persons. Private information should only be accessible to its owner. By Information Hiding we mean
“Showing only those details to the outside world which are necessary for the outside world and hiding all other details from the
outside world.”
In the perspective of Object Oriented Programming Information Hiding is,
           “Hiding the object details (state and behavior) from the users”
Information Hiding is achieved in Object Oriented Programming using the following principles,
• All information related to an object is stored within the object
• It is hidden from the outside world
• It can only be manipulated by the object itself
We can achieve information hiding using Encapsulation and Abstraction, so we see these two concepts in detail now,
Encapsulation
Encapsulation means “we have enclosed all the characteristics of an object in the object itself”
Encapsulation and information hiding are much related concepts (information hiding is achieved using Encapsulation)
Advantages of Encapsulation
Simplicity and clarity
As all data and functions are stored in the objects so there is no data or function around in program that is not part of any object
and is this way it becomes very easy to understand the purpose of each data member and function in an object.
Low complexity
As data members and functions are hidden in objects and each object has a specific behavior so there is less complexity in code
there will be no such situations that a functions is using some other function and that functions is using some other function.
Better understanding
Everyone will be able to understand whole scenario by simple looking into object diagrams without any issue as each object has
specific role and specific relation with other objects.
Interface:
Interface is a set of functions of an object that he wants to expose to other objects.
Implementation
It is actual implementation of the behavior of the object in any Object Oriented language.
Messages
Objects communicate through messages they send messages (stimuli) by invoking appropriate operations on the target object.
The number and kind of messages that can be sent to an object depends upon its interface
Lecture No 3

Abstraction
Real life objects have a lot of attributes and many kinds of behaviors but most of the time we are interested in only that part of
the objects that is related to the problem. this concept is called “Abstraction”. Abstraction is a way to cope with complexity and
it is used to simplify things.
Principle of abstraction:
“Capture only those details about an object that are relevant to current perspective”
Abstraction has following major advantages,
1. It helps us understanding and solving a problem using object oriented approach as it hides extra irrelevant details of objects.
2. Focusing on single perspective of an object provides us freedom to change implementation for other aspects of for an object
later.
Inheritance
A child inherits characteristics of its parents, besides inherited characteristics, a child may have its own unique characteristics
Inheritance in Classes
If a class B inherits from class A then it contains all the characteristics (information structure and behaviour) of class A
The parent class is called base class and the child class is called derived class Besides inherited characteristics, derived class
may have its own unique characteristics
Inheritance – “IS A” or “IS A KIND OF” Relationship
Inheritance – Advantages
1. Reuse            2. Less redundancy        3. Increased maintainability
Reuse with Inheritance
Main purpose of inheritance is reuse; we can easily add new classes by inheriting from existing classes. Select an existing class
closer to the desired functionality, create a new class and inherit it from the selected class, add to and/or modify the inherited
functionality
Lecture No 4
Generalization
In OO models, some classes may have common characteristics. We extract these features into a new class and inherit original
classes from this new class. Base class encapsulates the idea of commonality of derived classes. Base class is general class
representing common behavior of all derived classes. This concept is known as Generalization.
Sub-typing & Specialization
We want to add a new class to an existing model

More CS304 files

All CS304 files · Midterm Prep 2026 · MCQs Bank