22316 C++ Question Paper Winter 2023 PDF
Document Details
2023
Tags
Summary
This is a C++ question paper from Winter 2023. It contains various questions and programming problems related to topics like OOP, file operations, inheritance, and polymorphism. The questions cover different aspects of C++ programming.
Full Transcript
22316 23124 3 Hours / 70 Marks Seat No. Instructions – (1) All Questions are Compulsory. (2) Answer each next main Question on a new page. (3) Illustrate your answer with neat sketches wherever necessary....
22316 23124 3 Hours / 70 Marks Seat No. Instructions – (1) All Questions are Compulsory. (2) Answer each next main Question on a new page. (3) Illustrate your answer with neat sketches wherever necessary. (4) Figures to the right indicate full marks. (5) Assume suitable data, if necessary. (6) Mobile Phone, Pager and any other Electronic Communication devices are not permissible in Examination Hall. Marks 1. Attempt any FIVE of the following: 10 a) Differentiate between C and C++. (Any two points) b) Give the syntax of class. c) Explain any four applications of OOP. d) Give the syntax and use of fclose( ) function. e) Explain inline member function. f) Explain the input operator in C++. g) Explain reference and dereference operators w.r.t. pointer. P.T.O. 22316 Marks 2. Attempt any THREE of the following: 12 a) Explain the rules for naming variables in C++. (Any four points) b) Explain the access specifiers in C++. c) What is inheritance? Give different types of inheritance. d) Write a C++ program to find out whether the given number is even or odd (taking input from keyboard). 3. Attempt any THREE of the following: 12 a) Write a C++ program to find the area of rectangle using class rectangle which has following details – i) Accept length and breadth from the user. ii) Calculate the area iii) Display the result. b) Explain multilevel inheritance with an example. c) Write a C++ program to define structure student having data members name, roll no., age. Accept and display data for one student. d) Write a C++ program for write into a file using file operations. 4. Attempt any THREE of the following: 12 a) Write a C++ program to copy data from one file to another. b) Differentiate between compile time polymorphism and run time polymorphism. (Any four points) c) Explain the characteristics of Friend function. d) Write a program to declare a class measure having data members add1, add2 and add3. Initialize the data members using constructor and store their addition in third data member using function and display the addition. e) Differentiate between constructor and destructor in C++. (Any four points) 22316 Marks 5. Attempt any TWO of the following: 12 a) Write a C++ program to implement multiple inheritance as shown in Figure No. 1. Accept and display data of test marks and sport’s marks using object of class ‘result’. Fig. No. 1 b) Describe ‘this’ pointer in C++ with an example. c) Write a program to declare a class ‘employee’ containing data members ‘emp-id’ and ‘salary’. Accept and display this data for 10 employees. 6. Attempt any TWO of the following: 12 a) Explain the rules of virtual function. b) Explain virtual base class with an example. c) Write a program to declare a class ‘item’ containing data members as ‘item_name’, ‘code’, ‘price’. Accept and display the information for one object using pointer to that object.