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

Lab 5 OOP

The document outlines a project for a Computer Science course focused on Object Oriented Programming, detailing five tasks related to class creation and operator overloading. Tasks include designing a class for Lamborghini's Diablo car, implementing a class for 3D coordinates, comparing objects with overloaded operators, creating a Date class with increment operators, and developing a matrix class for summing two matrices. The project is due on January 8, 2025.

Uploaded by

hasimalikym15
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lab 5 OOP

The document outlines a project for a Computer Science course focused on Object Oriented Programming, detailing five tasks related to class creation and operator overloading. Tasks include designing a class for Lamborghini's Diablo car, implementing a class for 3D coordinates, comparing objects with overloaded operators, creating a Date class with increment operators, and developing a matrix class for summing two matrices. The project is due on January 8, 2025.

Uploaded by

hasimalikym15
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Project Title Page

Department of Computer Science


Muslim Youth University, Islamabad

Course Code: CS- 103


Course Title: Object Oriented Programming

Project No: 5

Task 1:
Lamborghini is an international luxury sports car developer stationed in Italy. The company
has a reputation for producing cars that are extremely expensive, powerful and rare.
Lamborghini has developed a brand-new model called the Diablo. The company produces a
very limited number of Diablo's each year. The company is producing the Diablo in only one
colour called the "Hot Red". When the company has produced a Diablo, the car has a number
of attributes like colour, cubic capacity, number of seats, year of manufacture, engine
number, frame number and owner name. Out of these attributes the attributes that remain the
same for all Diablo's being produced are colour, cubic capacity and number of seats. Suppose
you are working on a system specially designed for the Lamborghini Diablo. Follow the
instructions below for creating the class and objects:
 Store the owners name as a dynamic array data member.
 Create an object named "obj1" and initialize the object.
 Create a copy constructor that can copy all those attributes that remain the same for
all cars.
 Generate another object named "obj2" that is created by copying only those attributes
that are the same from "objl".
 Initialize the remaining attributes with values of your own
Task 2:
Write a class to store x, y, and z coordinates of a point in three-dimensional space. Overload
addition and subtraction operators for addition and subtraction of two coordinate objects.
Implement the operator functions as non-member functions (friend operator functions).
Task 3:
Write a program to compare two objects of a class that contains an integer value as its data
member. Make overloading functions to overload equality(==), less than(<), greater than(>),
not equal (!=), greater than or equal to (>=), and less than or equal to(<=) operators using
member operator functions.

1
Task 4:
Write a class Date that overloads prefix and postfix operators to increase the Date object by
one day, while causing appropriate increments to the month and year (use the appropriate
condition for leap year). The prefix and postfix operators in the Date class should behave
exactly like the built-in increment operators

Task 5:

Create a class called matrix that will find the sum of two matrices. To perform this task you
will need to create three private array data members that will hold the original arrays and an
array to hold the sum of the matrices. Suppose that the size of the matrices is 3 * 3.
Create a friend function which will add the matrices and store the result in the sum matrix.
The sum of two matrices is the sum of corresponding entries

Google Drive Link:

Best:

Average:

Worst:

Project # 4

Due dates (submit in Google classroom Project folder): 08-Jan-2025

You might also like