OOP Part 3
OOP Part 3
write down
appropriate code to create objects named as sphere and cylinder of the above class and
implement function overloading to calculate volume of a sphere and cylinder based
upon user input.
2. Create a class called Area which contains a method called "find_area". Write down
appropriate code to create objects named as circle and rectangle of the above class and
implement function overloading to calculate area of a rectangle and area of a circle
based upon user input.
3. Write a program to create a class shape with functions to find area of the shapes and
display the name of the shape and other essential component of the class. Create derived
classes circle, rectangle and trapezoid each having overridden functions area and
display. Write a suitable program to illustrate virtual functions and virtual destructor.
4. Implement a Circle class. Each object of this class will represent a circle. storing its
radius and the x and y coordinates of its center as floats. Include a default
constructor.access functions, an area() function, and a circumference() function.
5. Create a class called Employee which contains protected attributes such as emp_id,
emp_salary and emp_da. emp_da is 20% of the emp_salary. Provide an appropriate
method to take user input to initialize the attributes and display the details regarding 25
Employee of a class.
6. Write a complete program to create a class called Account with protected attributes
such as account number and balance. The attributes should be initialized through
constructors. The class contains a public method named as show() to display the
initialized attributes. Provide a mechanism to create an array of Account objects for the
30 account.