Assignment 3B

Download as pdf or txt
Download as pdf or txt
You are on page 1of 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