QB For OOP Practical
QB For OOP Practical
Q1. Write a C++ Program Which show the use of function outside the class using
scope resolution operator .
Q2. Write a program to create the memory using new operator and free the
created memory using delete operator .
Q3. a)Find the area of the Circle by casting double data into float and int type .
b) Write a program to print largest number among two number using
Conditional Operator .
Q5. Write a C++ Program to declare a class Staff having data members name,
basic salary, DA,HRA and calculate gross salary. Accept & display data for one
staff. By using function outside the class.
Where DA=74.5% Of basic
1. HRA=30% of basic.
2. Gross salary=basic+HRA+DA
Q6. a) Write a Program to create a class Number having data members n1 and
n2 and perform mathematical operations like addition ,subtraction ,
multiplication and division on two numbers using inline functions.
Q7. Write a program to create two classes test1 and test 2 which stores marks
of a student. Read value for class objects and calculate average of two tests
using friend function .
Q8. Write a Program to define a class having data members principal, duration
and rate of interest .Declare rate_of_interest as static member variable
Calculate the simple interest and display it .
b) Write a program to create the memory using new operator and free the
created memory using delete operator .
Q10. A) Define a class Student which contain member variables as rollno, name
And course. WAP using Constructor as “Computer Engineering” for
course. Accept this data for objects of class and display the data .
b) WAP to print “Hello” msg if entered value is more than 10 otherwise
print “bye” msg on output screen ( Use of Relational operator ).
Q11. A )WAP to define a class Employee having data members emp_no ,
emp_name and emp_designation .Derive a class Salary from Employee
having data members basic, hra, da, gross_sal.Accept and display data for
one employee .
b) Write a syntax for define member function Outside the class.
Q12. A) WAP to get the average marks of four subjects using Multiple
Inheritance.
b) WAP to display the message “Object Oriented Programming” using
manipulators.
Q13. WAP to implement the concept of Virtual Base Class for following figure.
Assume suitable data and function members.
Cricketer
Bowler Batsman
Allrounder
Q17. WAP to interchange the values of two int , float and char using function
overloading .
Q18. WAP to overload unary operators(++) increment and (--) decrement by
using member function .
Q19. WAP to find the area of various geometrical shapes by function
overloading.
Q20. WAP to declare a class Parent in which use read function , define another
class child use same read function. Display the data of both the read
function on output screen using virtual function .
Q21. WAP in C++ in which open a file read and write mode and display the
content on output screen using function open().
Q22. WAP in C++ in which open a file read and write mode and display the
content on output screen using constructor.
Q23. WAP to copy the contents of one file into another file.
Q24. WAP to implement sequential input and output operations on file.
Q25. WAP to write and read objects in a binary file using write() and read () methods.