0% found this document useful (0 votes)
47 views1 page

Assignment 3B

The document provides instructions for an object oriented programming lab assignment. It includes 4 questions to design classes and demonstrate OOP concepts like encapsulation, inheritance and operator overloading. It asks students to create classes for a chat message, complex number, game object and university staff hierarchy.

Uploaded by

ssc.hafsa.201109
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)
47 views1 page

Assignment 3B

The document provides instructions for an object oriented programming lab assignment. It includes 4 questions to design classes and demonstrate OOP concepts like encapsulation, inheritance and operator overloading. It asks students to create classes for a chat message, complex number, game object and university staff hierarchy.

Uploaded by

ssc.hafsa.201109
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/ 1

Tel: 92-51-9047846

Fax:92-51-9047420
UNIVERSITY OF ENGINEERING AND TECHNOLOGYTAXILA-47050
DEPARTMENT OF COMPUTER SCIENCE

Object Oriented Programming


Lab Assignment # 3B
Deadline: 29.05.2024

Clo-1 : Design (develop, test, and debug) programs using object-oriented techniques in conjuncture
with an integrated development environment
Clo-2: Demonstrate the use of modern tools for coding

(Marks= 10)
1. Assume that You are building a messaging application. Create
a ChatMessage class that encapsulates a message and provides
a friend function to count the number of words in the
message.
(hint: Implement ChatMessage class with proper
encapsulation. Write a friend function that counts the words
in a message)
2. You are developing a complex number library. Create a
Complex class that represents complex numbers. Implement
operator overloads for addition, subtraction, and
multiplication.
3. You are creating a game engine. Design a base class
GameObject with common properties like position and
rotation. Create a derived class Player that adds player-
specific features.(Define the GameObject and Player classes
using inheritance. Include relevant properties and methods)
4. Imagine You are building a university management system.
Design a class hierarchy that represents different types of
university staff: Person (base class), Faculty (derived from
Person), and Admin (derived from both Person and Faculty).
The goal is to demonstrate hybrid inheritance
Note:
- At the conclusion of each question's solution, please provide a brief explanation detailing your
approach in solving the problem. Describe the steps you took, the logic behind your code, and
any key decisions or algorithms used. (Short Description)
- Attach Screenshot of your executed program (having your name & Registration # in it ) at the end
of solution for each program
- Submit your solution file compiled in MS Word Document on MS Teams only with file name as
(Name - Registartion #) i.e EMAN KHALIQ- 23-CS-001

OOP Lab Instructor: Muhammad Faheem Saleem


Session: - CS-2K23

You might also like