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

Sheet-6 OOP

The document outlines programming assignments for the Object Oriented Programming course at Menoufia University for the 2024/2025 academic year. It includes tasks to create C++ programs for calculating areas of geometric shapes, simulating a simple calculator, representing a car with price manipulation, and creating a time class with specific functionalities. Each task emphasizes the use of classes and object-oriented principles in C++.

Uploaded by

seifelshaa8
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)
2 views1 page

Sheet-6 OOP

The document outlines programming assignments for the Object Oriented Programming course at Menoufia University for the 2024/2025 academic year. It includes tasks to create C++ programs for calculating areas of geometric shapes, simulating a simple calculator, representing a car with price manipulation, and creating a time class with specific functionalities. Each task emphasizes the use of classes and object-oriented principles in C++.

Uploaded by

seifelshaa8
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

Menoufia University Computer Programming

Faculty of Electronic Engineering AC Year: 2024/2025


Special Programs ‫جام عة الم نوف ية‬ 1st Semester

Sheet [6]: Object Oriented Programming


[1] By using classes, write a C++ program to calculate the area of Square,
Rectangle, and Triangle. Create three objects (sqr, rect, and tr) of types
(Square, Rectangle, and Triangle) respectively, then input the required
dimensions for each object from the keyboard, and finally display the
area of each object on the screen.
[2] By using classes, write a C++ program to simulate simple calculator that
performs the 4 mathematical operations addition, subtraction,
multiplication and division of two numbers.
[3] Write an OOP complete program to represent a car, the class
constructor will set the values to all its data members then create a
member function outside the class to display the car price, and then
create a function to increase the car price by 1000. The main() program
should create an object. Then display the car price.
[4] Create a class called time that has separate int member data for hours,
minutes, and seconds. One constructor should initialize this data to 0,
and another should initialize it to fixed values. Another member function
should display it, in 11:59:59 format. The final member function should
add two objects of type time passed as arguments.
A main() program should create two initialized time objects and one that
isn‟t initialized. Then it should add the two initialized values together,
leaving the result in the third time variable. Finally it should display the
value of this third variable.

You might also like