All types of Inheritances in C++ Programs.
-
Create a class student which stores name, roll number and age of a student. Derive a class test from student class, which stores marks in 5 subjects. Input and display the details of a student. (Single Inheritance)
-
Extend the program 1 to derive a class from result from classs ‘test’ which includes member function to calculate total marks and percentage of a student. Input the data for a student and display its total marks and percentage. (Multilevel Inheritance)
-
Extend the program 1 to include a class sports, which stores the marks in sports activity. Derive the result class from the classes ‘test’ and ‘sports’. Calculate the total marks and percentage of a student. (Hybrid Inheritance)
-
Create a class ‘shape’. Derive three classes from it: Circle, Triangle and Rectangle. Include the relevant data members and functions in all the classes. Find the area of each shape and display it. (Hierarchal Inheritance)
-
Create a class which stores employee name,id and salary Derive two classes from ‘Employee’ class: ‘Regular’ and ‘Part-Time’. The ‘Regular’ class stores DA, HRA and basic salary. The ‘Part-Time’ class stores the number of hours and pay per hour. Calculate the salary of a regular employee and a par-time employee. (Hierarchal Inheritance)
-
WAP in C++ which will implement the concept of multiple inheritance with ambiguity resolution.