0% found this document useful (1 vote)
104 views

Inheritance Questions Mostly

The assignment involves completing C++ programs using operator overloading and inheritance; students are to solve all problems independently and not copy solutions from websites. It includes 35 problems covering topics like complex number operations, rational number arithmetic, finding areas and volumes of shapes, inheritance between multiple classes, storing vehicle and student information using inheritance, and templated classes. Students are encouraged to reference websites but not copy solutions.

Uploaded by

Aaron Abraham
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
104 views

Inheritance Questions Mostly

The assignment involves completing C++ programs using operator overloading and inheritance; students are to solve all problems independently and not copy solutions from websites. It includes 35 problems covering topics like complex number operations, rational number arithmetic, finding areas and volumes of shapes, inheritance between multiple classes, storing vehicle and student information using inheritance, and templated classes. Students are encouraged to reference websites but not copy solutions.

Uploaded by

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

Assignment 2

Assignment date:-13-07-2023

Inheritance and operator overloading programs

Students are encourage to do all problems yourself, you could reference website but could not copy.

1. C++ Program to add Two Strings using overloading


2. C++ Program to Perform Complex Operations(add, subtract) using Overloading
3. C++ program to Swap variables using function overloading
4. C++ program for show Counter using Overloading unary operator ++
5. C++ program to perform operations on complex numbers
6. C++ class Program to perform rational number arithmetic
7. C++ class Program to perform Complex Arithmetic using operator overloading
8. C++ Program to Find the Area of shapes using function overloading
9. C++ Program to check Palindrome using function overloading
10. C++ program to find area of square,rectangle,circle and triangle
11. C++ program to find volume of cube, cylinder, sphere by function overloading
12. C++ program to demonstrate example of simple inheritance.
13. C++ program to demonstrate example of private simple inheritance.
14. C++ program to read and print student's information using two classes and simple inheritance.
15. C++ program to demonstrate example of multilevel inheritance.
16. C++ program to read and print employee information using multiple inheritance.
17. C++ program to demonstrate example of multiple inheritance.
18. C++ program to demonstrate example of hierarchical inheritance to get square and cube of a number.
19. C++ program to read and print employee information with department and pf information using
20. C++ Program to access protected data member using Inheritance
21. C++ Program for enter Patient details using Inheritance
22. C++ Program to demonstrate an Example of Hybrid Inheritance
23. C++ program display student marksheet using multiple inheritance
24. C++ Program to find Area of Rectangle using inheritance
25. C++ Program to show access to private, public and protected using Inheritance
26. C++ Program to enter Student details of different Stream using Hierarchical Inheritance
27. C++ Program to find area and volume using multiple inheritance
28. C++ Program to Overriding the member functions using Inheritance
29. Create two classes named Mammals and MarineAnimals. Create another class named BlueWhale which
inherits both the above classes. Now, create a function in each of these classes which prints "I am
mammal", "I am a marine animal" and "I belong to both the categories: Mammals as well as Marine
Animals" respectively. Now, create an object for each of the above class and try calling
1 - function of Mammals by the object of Mammal
2 - function of MarineAnimal by the object of MarineAnimal
3 - function of BlueWhale by the object of BlueWhale
4 - function of each of its parent by the object of BlueWhale
30. Make a class named Fruit with a data member to calculate the number of fruits in a basket. Create two
other class named Apples and Mangoes to calculate the number of apples and mangoes in the basket.
Print the number of fruits of each type and the total number of fruits in the basket.
31. We want to calculate the total marks of each student of a class in Physics,Chemistry and Mathematics and
the average marks of the class. The number of students in the class are entered by the user. Create a class
named Marks with data members for roll number, name and marks. Create three other classes inheriting
the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in
individual subject of each student. Roll number of each student will be generated automatically.
32. We want to store the information of different vehicles. Create a class named Vehicle with two data
member named mileage and price. Create its two subclasses
*Car with data members to store ownership cost, warranty (by years), seating capacity and fuel type
(diesel or petrol).
*Bike with data members to store the number of cylinders, number of gears, cooling type(air, liquid or
oil), wheel type(alloys or spokes) and fuel tank size(in inches)
Make another two subclasses Audi and Ford of Car, each having a data member to store the model type.
Next, make two subclasses Bajaj and TVS, each having a data member to store the make-type.
Now, store and print the information of an Audi and a Ford car (i.e. model type, ownership cost,
warranty, seating capacity, fuel type, mileage and price.) Do the same for a Bajaj and a TVS bike.
33. Create a class named Shape with a function that prints "This is a shape". Create another class named
Polygon inheriting the Shape class with the same function that prints "Polygon is a shape". Create two
other classes named Rectangle and Triangle having the same function which prints "Rectangle is a
polygon" and "Triangle is a polygon" respectively. Again, make another class named Square having the
same function which prints "Square is a rectangle".
Now, try calling the function by the object of each of these classes.
34. C++ Program of templated class derived from non-templated class
35. C++ Program of non-templated class derived from templated base class
36.C++ Program of templated class derived from another templated class

You might also like