Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Oop Practical Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

OOP Practical Exam Date: 26/12/2022 (IF3IC)

OOP Practical Questions


1. Write a program to check whether the entered year is a leap year.
2. Write a program to print multiplication table of 7.
3. Write a program to check whether a number is palindrome or not.
4. Write a program to find smallest and second smallest element in an array.
5. Write a program to find transpose of 2*2 matrix.
6. Write a program to declare a class Book having data members as book_name, author
and price. Accept and display data for book having maximum price.
7. Write a program to define a class City having data members as name, population.
Accept and display data for 10 cities.
8. Write a program to swap two numbers using friend function.
9. Write a program to define a class “Product” having data members as prod_id,
prod_name, prod_price. Accept and display data for 3 products using constructor
overloading.
10. Write a program to define a class Student having data members as roll_no, name.
Derive a class Marks from student having data members as m1, m2, m3, total and
percentage. Accept and display data for 1 student.
11. Write a program to implement following multilevel inheritance.

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.

You might also like