Oop Practical Questions
Oop Practical Questions
Oop Practical Questions
12. Write a program to declare a class Book containing data members book_name,
author_name and price. Accept this information for one object of the class using pointer
to that object.
13. Write a program to declare a class "polygon" having data members width and height.
Derive classes "rectangle" and "triangle" from "polygon" having area() as a member
function. Calculate area of triangle and rectangle using pointer to derived class object.
14. Write a program to overload unary operators (++) increment and (--) decrement.
15. Write a program to compare two strings using "= =" operator overloading.
16. Write a program to find the area of various geometrical shapes by function overloading.
17. Write a program to count number of spaces in a file.
Instructions
1. Any one program can be there in practical examination (by paper selection).
2. First execute the given program and get the output.
3. Write program code and output for given example on answer sheet provided.
4. Attendance, practical book, I card, hall ticket is mandatory.
5. Avoid malpractices.