Skip to content

abhaykumarmandal/Inheritance-programs

Repository files navigation

Inheritance-programs

All types of Inheritances in C++ Programs.

  1. 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)

  2. 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)

  3. 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)

  4. 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)

  5. 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)

  6. WAP in C++ which will implement the concept of multiple inheritance with ambiguity resolution.

About

All types of Inheritances in C++ Programs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages