Skip to content
VUBuddy

CS304 Midterm Notes Lectures 1-22

Object Oriented Programming PDF 3.4 MBUpdated 23 Oct 2026
Midterm past paper CS304 Midterm Notes Lectures 1-22 PDF 3.4 MB
vubuddy.com
Type
Midterm past paper
Course
CS304 Object Oriented Programming
Size
PDF 3.4 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 3.4 MB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 121. Download the file for all 121 pages.

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 Behavior and attributes such as name ,age etc. Time is an intangible object that have some state (hours, seconds,, minutes)

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

  1. Ali’s name is stored within his brain

Information Hiding Advantages

  1. Simplifies the model by hiding implementation details
  2. It is a barrier against change propagation
  3. 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

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

Encapsulation Advantages

  1. Simplicity and clarity
  2. Low complexity
  3. 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.

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

Example Interface of a Car

  1. Steer Wheels
  2. Accelerate
  3. Change Gear
  4. Apply Brakes
  5. 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.

All CS304 files →
CS304 Object Oriented Programming All CS304 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.