0% found this document useful (0 votes)
33 views5 pages

QB For OOP Practical

Uploaded by

anupatil7576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

QB For OOP Practical

Uploaded by

anupatil7576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

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 .

Q4. Write a program to define a class Employee having data members as


empname and emp id .Accept and display data for one object. Define the
member function inside the class.

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.

b) Write a C++ code to evaluate following expressions using input output


function : y=2*x-4 , where value of x is taken from the user. Find the
value of y

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 .

Q9. a) Write a Program to declare a class Account , having data members as


Account_no and balance .Accept this data for 10 accounts and display
data of Accounts having balance greater than 10000.

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

Q14. WAP Which show the use of constructor in derived class .


Q15. WAP to declare a class Box having data members as height , width ,
Breadth . Accept this information for one object using pointer to that
object .Display the area and volume of that object .

Q16. A) WAP which show the use of this pointer .


B) WAP Which show the use of Pointer to derived class in multilevel
inheritance.

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.

You might also like