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

Inheritance

This document outlines an assignment on inheritance concepts in C++ for an Object Oriented Programming and Data Structures laboratory class. It provides 6 programming problems involving inheritance with classes like Student, Employee, Media, and CollegeCourse. Problem A asks to inherit a Student class into other student types and access a record using pointers. Problem B involves multiple inheritance with Employee, Salary, and Payroll classes.

Uploaded by

SHYAM
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)
111 views1 page

Inheritance

This document outlines an assignment on inheritance concepts in C++ for an Object Oriented Programming and Data Structures laboratory class. It provides 6 programming problems involving inheritance with classes like Student, Employee, Media, and CollegeCourse. Problem A asks to inherit a Student class into other student types and access a record using pointers. Problem B involves multiple inheritance with Employee, Salary, and Payroll classes.

Uploaded by

SHYAM
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

SSN COLLEGE OF ENGINEERING, KALAVAKKAM – 603 110

DEPARTMENT OF INFORMATION TECHNOLOGY

Subject Code: UEC2312 Staff Name: J. K. Josephine Julina


Subject Title: OOPS And Data Structures Laboratory Class: III SEM ECE
Batch: 2021 – 2025 Academic Year: 2022-2023
Due: Tuesday, 6 December 2022, 12:00 AM
9. Write C++ a program to demonstrate all the inheritance concepts
a. Develop a class student in C++. Inherit it into engineering, arts, commerce, and science
students. Inherit engineering student into computer science, electronics and communication,
and information technology student. Write a program to use pointer to the student class to
access a record of the computer science student.
b. Write three different classes named as employee, salary and payroll. Class employee stores the
empno, empname and design. Class salary stores basic, da and pf. Inherit minimum of five
employees and obtain the payroll using multiple inheritance.
c. Implement the following class hierarchy.

d. Write three different classes named as student, test, and total. Class student stores the
roll_number, Class test stores the marks obtained from three subjects and class result contains
the total marks obtained from the test. The class result can inherit the details of the marks
obtained from the test and the roll_number of students through multilevel inheritance.
e. Write a class named as media that stores the title and price of a publication. Create two derived
classes, one for storing the number of pages in a book named as book and another for storing
the playing time of a tape named as tape. Using virtual function display() the details of book
and tape. [Optional]
f. A CollegeCourse class includes fields representing department, course number, credit hours,
and tuition. Its child, Labcourse, includes one more field that holds a lab fee charged in addition
to the tuition. Create appropriate functions for these classes, and write a main () function that
instantiates and uses object of each class. [Optional]

Prepared by,
J. K. Josephine Julina

You might also like