lOMoARcPSD|47214044
CS304 P-Programming Lab
Object Oriented Programming (Virtual University of Pakistan)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Shahroz Arshad (
[email protected])
lOMoARcPSD|47214044
Programming Lab
CS304P – Object Oriented Programming
Department of Computer Science, Virtual University of Pakistan
lOMoARcPSD|47214044
Lab 01
Consider the following scenario and identify all objects, their attributes and behaviors.
In Virtual University bookshop, the handouts of all courses are provided at reasonable price. The
handouts are made in accordance with the video lectures recorded by famous professors. It is a step to
facilitate students to easily digest the course contents.
Solution:
BookShop
Characteristics (Attributes) Behavior (Operations)
Name Set Order
Address Get Order
Phone No Confirm Order
Deliver Order
Update Order
Receive Payment
Handouts
Characteristics (Attributes) Behavior (Operations)
Title Download
Author Name Upload
Number of Pages Read
Number of Chapters Write
Created Date Edit
Modified Date
lOMoARcPSD|47214044
Video Lecture
Characteristics (Attributes) Behavior (Operations)
Video Lecture No Record
Video Name Upload
Video Duration Download
Video URL Watch
Stop
Forward
Reverse
Increase Speed
Decrease Speed
Increase Volume
Decrease Volume
Playback
Professor
Characteristics (Attributes) Behavior (Operations)
Name Teach
Age Develop Assignment
Gender Develop Quiz
Employee ID Develop GDB
Qualification Prepare Exam
Specialization Take Exam
Experience Mark Activities
lOMoARcPSD|47214044
Student
Characteristics (Attributes) Behavior (Operations)
Name Study
Age Give Exam
Gender Attempt Activities
Student ID
Study Program
Current Semester
CGPA
Course
Characteristics (Attributes) Behavior (Operations)
Course Code Add Course Information
Course Title Publish Course Information
Credit Hours View Course Information
Total Marks Edit Course Information
Course Instructor
lOMoARcPSD|47214044
Course Content
Characteristics (Attributes) Behavior (Operations)
Number of Topics Upload
Topic No View
Topic Description Write
Composed by Edit
Published by
Note: Everyone visualizes real life problems in different ways, so solutions
may vary from student to student. Further, Students can also add more
Attributes/ Behaviors.
lOMoARcPSD|47214044
Lab 02
In the below diagram, we have two different types of file classes (PDF and Video). You are required to
apply the concept of generalization on the given classes and draw class diagram showing this
generalization relationship.
Solution:
lOMoARcPSD|47214044
Lab 03
Write a program which consists of a class named Room having two data members
Height and Width, the class should also consist of three constructors i.e. Default
constructor, one argument constructor and two arguments constructor.
After running your program, the following screen should display.