CS304 Mid-term notes 1-22.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)
Tags
MIDTERM

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 CS304 Mid-term notes 1-22.pdf for free?

You can preview and download "CS304 Mid-term notes 1-22.pdf" (CS304 PDF, ~240 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs304-mid-term-notes-1-22-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

                       Made by ᵛᵘ £lon musk ᶠⁱˡᵉˢ
                       CS304 Mid term Notes
                                 Lec 1 to 22

Lecture No.01 Object-Orientation (OO)

What is Object-Orientation?

A system in which we deal with our programming problems in the form of Objects and their
relations in real life.

For example

(School), the objects in a school are student, teacher, books, pen, school bag, classroom, parents,
playground etc.

What is a Model?

A model is a small copy/object of something real/abstract/ tangible/conceptual. Objects have
their attributes (color/model), operations (working) & identity.
For example:
     Highway maps
     Architectural models
     Mechanical models

Object oriented Model?

Object oriented model show some interacting objects to understand a system given to us for
execution.
 Advantages:

  I.   It is easy to understand
 II.   It can be easily develop because it is closer to real life.
III.   It is easy to implement using any object Oriented language like c++.

What is an Object?

In object-oriented programming (OOP), objects are the things you think about first in designing a
program and they are also the units of code that are eventually derived from the process.

Tangible and Intangible Objects

Tangible Objects                                 Intangible Objects
Ali is a tangible object, have some              Time is an intangible object that have some
Behavior and attributes such as name ,age        state (hours, seconds,, minutes)
etc.

Lecture No.02 Lecture Contents

What is information hiding?

We have objects with their attributes and behaviors that are hidden from other classes. Object
oriented programming follows the principle of information hiding.

Information Hiding is achieved using the following principles,

Information is stored within the object. It is hidden from the outside world. It can only be
manipulated by the object itself.
 Example

   ► Ali’s name is stored within his brain

Information Hiding Advantages

   ► Simplifies the model by hiding implementation details

   ► It is a barrier against change propagation

   ► We can achieve information hiding using Encapsulation and Abstraction there are two
     concepts.

What is Encapsulation?

Encapsulation means “we have enclosed all the characteristics of an object in the object itself”.
Object characteristics include data members and behavior of the object in the form of functions.

Example

   ► Ali stores his personal information and knows how to translate it to the desired language.

Encapsulation Advantages

   ► Simplicity and clarity

   ► Low complexity

   ► Better understanding

What is Interface?

Interface is a set of functions of an object that he wants to expose to other objects. We have to
use the concept of interface of the object to expose its behavior to outer word objects.

   ► Interface of an object may be different for different objects.
   ► Interfaces are necessary for object communication.

Example Interface of a Car

   ► Steer Wheels

   ► Accelerate

   ► Change Gear

   ► Apply Brakes

   ► Turn Lights On/Off

What is Implementation?

It is actual implementation of the behavior of the object in any Object Oriented language. It has
two parts,

   • Internal data structures to hold an object state that will be hidden from us it will store
     values for an object data members.
   • Functionality in the form of member functions to provide required behavior.

Separation of Interface & Implementation

The benefit of using this approach is that our object interface to outside word becomes
independent from inside implementation of that interface. This is achieved through the concepts
of encapsulation and information hiding.

Advantages of Separation

   ► Users need not to worry about a change until the interface is same

   ► Low Complexity

   ► Direct access to information structure of an object can produce errors

What is Messages passing in oop?

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.

Examples Messages

A Person sends message (stimulus) “stop” to a Car by applying brakes.

Lecture No.03

What is Abstraction?

Abstraction is a way to cope with complexity and it is used to simplify things.

What is Principle of abstraction?

“Capture only those details about an object that are relevant to current perspective”.

Abstraction Example:

Ali is a PhD student and teaches BS students

Attributes

- Name                               - Employee ID

- Student Roll No                    - Designation

- Year of Study                       - Salary

- CGPA                                         - Age

Abstraction Advantages

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.

What is Classes in oop?

In an OO model, some of the objects exhibit identical characteristics (information structure and
behavior).We says that they belong to the same class.

Example – Class

    Ali studies mathematics

    Anam studies physics

    Sohail studies chemistry

Class Representation:

We can represent a class using a rectangle as follows,

What is Inheritance?

A child inherits characteristics of its parents. Besides inherited characteristics, a child may have
its own unique characteristics.

Inheritance in Classes

The parent class is called base class and the child class is called derived class. Derived class
may have its own unique characteristics.

Inheritance – “IS A” or “IS A KIND OF” Relationship.

Inheritance – Advantages

   ► Reuse

   ► Less redundancy

   ► Increased maintainability

Reuse with Inheritance

More CS304 files

All CS304 files · Midterm Prep 2026 · MCQs Bank