Question Bank OOP
Question Bank OOP
5 File operations 14
Course Outcome
Q.1 Attempt any FOUR 4*2=8Marks (CO)
Course Outcome
Q.1 Attempt any FOUR 4*2=8Marks (CO)
f) (CO-316.5)
File operations
(CO-316.5)
d) File operations
CO-
316.01 Develop C++ program to solve problem using Procedure Oriented Approach.
CO-
316.02 Develop C++program using classes and objects.
CO-
316.03 Implement Inheritance in C++ program.
CO-
316.04 Use Polymorphism in C++ program.
CO-
316.05 Develop C++ program to perform file operations.
Q9.What is function ?What is call by value? What is call by reference? What is difference
between them?
Q10.Give syntax and example of defining structure and declaring structure variables.
Q11. Write a C++ program to find whether the entered number is even or odd.
Q12.Write a C++ program to declare a structure employee with member as empid and
empname.Accept and display data for one employee using structure variable
Q15. Write a program to swap two integer values by using call by reference.
Q17.Write a C++ program to accept array of five elements, find and display smallest
number from an array.
(example 7*1=7…..7*10=70)
Q20. Write a C++ program to declare a structure employee with member as empid and
empname .Accept and display data for one employee using structure variable.
Q4.How many way we can define member function in class?Give it‟s syntax.
Q8. List characteristic of static data member and static member function.
Q9.What do you mean by inline function ?Write its syntax and example
Q18.What is copy constructor ?Give the syntax and example for copy constructor.
Q23. Write a program to calculate area of circle and rectangle using the concept of function
overloading.
Q24. Write a C++ program to declare a class „circle‟ with data members as radius and
area. Declare a function getdata to accept radius and putdata to calculate and display area
of circle.
Q25. Write a C++ program to declare a class addition with data members as x and y.
Initialize value of x and y with constructor. Calculate addition and display it using function
„display.‟
Q26. Write a C++ program to swap two integer numbers and swap two float
numbers using function overloading.(Hint : overload swap function)
Q27. Write a C++ program to find greatest number among two numbers from
two different classes using friend function.
Q11. Write a C++ program to declare a class „College‟ with data members as name
and college code. Derive a new class „student‟ from the class college with data
members as sname and roll no. Accept and display details of one student with
college data.
Class : Info
Accept and display data of one teacher and one student using object of class „Info‟.
Prepared By: Ms.S.S.Rajole (Department of Information Technology) Page 13 of 18
Q13 Write a C++ program to implement following inheritance.
Class : Employee
Data : empid
Member : empcode
SAccept and display data for one programmer and one manager.
Q14.Write C++ program for following multilevel inheritance.
Class : Carmanufacturer
datamember : Name
Class : Carmodel
datamember : Model name,
Model no.
Class : Car
datamember : Car no., colour
Accept and display data for one car with all details.
Q15.Write a C++ program to declare a class COLLEGE with members as college code.
Derive a new class as STUDENT with members as studid. Accept and display details of
student along with college for one object of student.
Class
Prepared By: Ms.S.S.Rajole (Department of Information: Technology)
Result Page 14 of 18
data mem : Total
Q18.Write a C++ program to implement following in heritance. Refer Figure
Class : Result
Q22.Write a program to copy the content of one string to another string using pointer to
string .
Q23.Write a program to declare a class Account having data member as acc_no and
balance. Accept and display data for five object using pointer to array of object.
Q24.Write a program which concate and reverse string by using pointer to string.
Q25.Write a program for overloaded of ++ unary operator for inch of feet conversion.
12 inches = 1 feet
Q26. Write a program to copy content of one string to another string using pointer to string.
Q28. Implement a program to declare a class city with data member city name and state.
Accept and display data for 1 object using pointer to object.
Q29. Write a program to search a number from an array using pointer to array.
Q31. Write a C++program to overload binary operator „+‟ to concatenate two strings.
(i) ios : : in
(i) get()
(ii) put()
Q3.Explain the any two file stream classes needed for the file manipulation.
Q5.Explain the function used to read and write data in binary file.
Q7.Explain the namespace in C++ ,with their syntax and Rule with example.
Q9.Write a C++ program to write “Welcome to poly” in a file .Then read the data from file
and display it on screen