R23EP053

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

NAME: N SWAROOP

SRN: R23EP053

SECTION: ECM-E

C++ ASSIGNMENT 1

1.Design a source code in C++ class Student with data members: name, roll
No , and marks. Implement a constructor to initialize these values, and a
destructor to display a message when an object is destroyed. Create an array
of objects for 5 students and demonstrate how constructors and destructors
work. (Output should contain your details as part of the implementation).
2.Implement a class Person with attributes name and age. Create a derived
class Employee that inherits from Person and adds an additional attribute
employee ID. Write a C++ program to demonstrate the use of single
inheritance by creating objects of both classes and displaying their details.
3.Write a C++ program to create a class Book with data members: title,
author, price, and publisher. Implement a method to set the details of the
book and another method to display the details. Create multiple book objects
(objects providing direct and indirect addressing) to test your class.

You might also like