OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
Bahria University,
Karachi Campus
COURSE: OBJECT ORIENTED PROGRAMING
TERM: Spring 2020, CLASS: BSE- 2(B)
Submitted By:
MUHAMMAD SOHAIL ABBAS 02-131192-012
65128
(Name) (Reg. No.)
Assignment No:
__01____
Submitted To:
Engr.M FAISAL
MUHAMMAD SOHAIL ABBAS 02-131192-012
OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
Signed Remarks: Score:
Q NO#1: This assignment is related to data abstraction and modeling’s, where you are
supposed to list down any 10 entities, list all the properties and methods of each entity then
apply data abstraction process where you are supposed to filter our only relevant properties
and relevant methods. Finally you have to make class diagram of each entity. Following are the
examples of class diagrams where + (Public) and – (Private).
SOLUTION:
ENTITY #1: CAR
ATTRIBUTES: Model, Manufacturer, Color, Engine, Fuel, Engine power (hp), Register number
(Name plate)
FUNCTIONS: Drive, Start, Stop, Headlights (on/off), Horn blow, Doors (open/close)
Car
+ model String
+ manufacturer String
+ color String
+ Engine String
+ Fuel String
+ Engine power(hp) int
+ name plate int
+ void display
MUHAMMAD SOHAIL ABBAS 02-131192-012
OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
ENTITY #2: HOUSE
ATTRIBUTES: House no#, Area, no# of Rooms, Dimension, Paint color, Material Used, Type,
Price.
FUNCTIONS: Open/close, rent, display, storage
House
+ House no# String
+ Area String
+no# of rooms int
+Dimension String
+ color String
+Material String
+type String
+ price int
+ void display
+ void open/close
ENTITY #3: Fan
ATTRIBUTES: Manufacturer, Body (size), material, technology, Speed (RPM), Power, Price
FUNCTIONS: On/Off, Display info, Run
Fan
+ Manufacturer String
+ Body String
+Material String
+Technology String
+ Speed int
+Power int
+ price int
+ void display
+ void on\off
MUHAMMAD SOHAIL ABBAS 02-131192-012
OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
ENTITY #4: Mobile phone
ATTRIBUTES: Manufacturer, Model, Storage, Color, Price, Battery Power
FUNCTIONS: On/Off, Display info, Call, Messages
Mobile
+ Manufacturer String
+ Model String
+Storage int
+ color String
+ Battery Power int
+ price int
+ void display
+ void on\off
+ void Calls
+ void Messages
ENTITY #5: Laptop
ATTRIBUTES: Manufacturer, Model, Storage, Color, technology, Processor, Price, Battery Power
FUNCTIONS: On/Off, Display info, Games, Coding,
Mobile
+ Manufacturer String
+ Model String
+Storage int
+ color String
+technology String
+processor String
+ Battery Power int
+ price int
+ void display
+ void on\off
+ void Gaming
+void Coding
MUHAMMAD SOHAIL ABBAS 02-131192-012
OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
ENTITY #6: Air Conditioner
ATTRIBUTES: Manufacturer, Model, Technology, Color, Price, Power, Weight
FUNCTIONS: On/Off, Display info, Cooling, Auto
AC
+ Manufacturer String
+ Model String
+Technology String
+ color String
+ Power int
+ price int
+ Weight int
+ void display
+ void on\off
+ void Cooling
+ void Auto
ENTITY #7: Television
ATTRIBUTES: Manufacturer, Model, Color, Price, Size, Technology
FUNCTIONS: On/Off, Display info, Volume UP/down. Channel Change
TV
+ Manufacturer String
+ Model String
+Size int
+ color String
+ Technology String
+ price int
+ void display
+void on\off
+ void Volume
+void Channel change
ENTITY #8: Refrigerator
MUHAMMAD SOHAIL ABBAS 02-131192-012
OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
ATTRIBUTES: Manufacturer, Model, Size, Type, Color, Price, Power
FUNCTIONS: On/Off, Display info, cooling
Mobile
+ Manufacturer String
+ Model String
+Size int
+ Color String
+type String
+ Power int
+ price int
+ void display
+ void on\off
+ void Cooling
ENTITY #9: Fighter jet
ATTRIBUTES: Manufacturer, Model, Price, Speed, Weight, Size, Technology
FUNCTIONS: On/Off, Display info, Flight, Firing
Mobile
+ Manufacturer String
+ Model String
+Weight int
+ Technology String
+ Size int
+ price int
+speed int
+ void display
+ void on\off
+ void Flight
+ void Firing
ENTITY #10: BANK
ATTRIBUTES: Name, Branch, Location, Headquarter, Net Income, Packages
MUHAMMAD SOHAIL ABBAS 02-131192-012
OBJECT ORIENTED PROGRAMING ASSIGNMENT#1
FUNCTIONS: Input, Display, Transactions, Deposit, Transfer
Mobile
+ Name String
+ Branch String
+Location String
+ Headquarter String
+ Net Income int
+ Packages String
+ void display
+void input
+ void Transaction
+void transfer
MUHAMMAD SOHAIL ABBAS 02-131192-012