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

cs304-p-programming-lab (1)

The document outlines programming lab exercises for CS304P - Object Oriented Programming at the Virtual University of Pakistan. It includes scenarios for identifying objects, their attributes, and behaviors related to a bookshop and course materials, as well as tasks for creating class diagrams and writing a Room class program. Each lab emphasizes applying object-oriented programming concepts through practical examples and coding tasks.

Uploaded by

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

cs304-p-programming-lab (1)

The document outlines programming lab exercises for CS304P - Object Oriented Programming at the Virtual University of Pakistan. It includes scenarios for identifying objects, their attributes, and behaviors related to a bookshop and course materials, as well as tasks for creating class diagrams and writing a Room class program. Each lab emphasizes applying object-oriented programming concepts through practical examples and coding tasks.

Uploaded by

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

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

Downloaded by Shahroz Arshad ([email protected])


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

Downloaded by Shahroz Arshad ([email protected])


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

Downloaded by Shahroz Arshad ([email protected])


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

Downloaded by Shahroz Arshad ([email protected])


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.

Downloaded by Shahroz Arshad ([email protected])


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:

Downloaded by Shahroz Arshad ([email protected])


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.

Downloaded by Shahroz Arshad ([email protected])

You might also like