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

Week 8 (Object Oriented Programming) Inheritance and Method Overiding

This document discusses object-oriented programming concepts including inheritance, method overriding, composition, and operator overloading. It provides questions to create a Car class composed of part classes like doors and wheels, and a Box class with width, height, and length data members along with functions to show data and calculate volume, overloading operators for addition, subtraction, multiplication and division of Box objects.

Uploaded by

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

Week 8 (Object Oriented Programming) Inheritance and Method Overiding

This document discusses object-oriented programming concepts including inheritance, method overriding, composition, and operator overloading. It provides questions to create a Car class composed of part classes like doors and wheels, and a Box class with width, height, and length data members along with functions to show data and calculate volume, overloading operators for addition, subtraction, multiplication and division of Box objects.

Uploaded by

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

Week 8(Object Oriented Programming)

Inheritance and Method Overiding

Question #2.

Apply the Concept of Composition by Creating part classes(doors,windows,Engine,Wheels) and than

Create a whole class Car that is composed of all these defined parts.
Question #3.

Create Box class containing data members (width ,height,Length) and Member functions showdata
and Volume.. Apple the concept of Operator Overloading and overload operators (+,-,* ,/) for addition
subtraction multiplication and division of Objects of Box class.

You might also like