0% found this document useful (0 votes)
45 views

Assignment 1 ..Oop..

This document contains an assignment on object-oriented programming submitted by Muhammad Sohail Abbas to Engr. M Faisal. The assignment asks students to list 10 entities, their properties and methods, and create class diagrams for each. Sohail provides examples for Car, House, Fan, Mobile Phone, Laptop, Air Conditioner, Television, Refrigerator, Fighter Jet, and Bank by listing their attributes and functions and drawing class diagrams with + and - visibility modifiers.

Uploaded by

Muhammad Sohail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Assignment 1 ..Oop..

This document contains an assignment on object-oriented programming submitted by Muhammad Sohail Abbas to Engr. M Faisal. The assignment asks students to list 10 entities, their properties and methods, and create class diagrams for each. Sohail provides examples for Car, House, Fan, Mobile Phone, Laptop, Air Conditioner, Television, Refrigerator, Fighter Jet, and Bank by listing their attributes and functions and drawing class diagrams with + and - visibility modifiers.

Uploaded by

Muhammad Sohail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

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

You might also like