All posts from

Z12304 C++ Programming DCS Question Paper Model : psgpolytech.ac.in

College : Psg Polytechnic College
Degree : DCS (Diploma in Computer Science)
Semester : III
Subject :Z12304 C++ Programming
Document Type : Model Question Paper
Website : psgpolytech.ac.in

Download Model/ Sample Question Papers :https://www.pdfquestion.in/uploads/psgpolytech.ac.in/6195-Z12304.pdf

C++ Programming Question Paper :

PSG POLYTECHNIC COLLEGE, COIMBATORE – 641 004
DIPLOMA ODD SEMESTER EXAMINATIONS – OCT 2014

Related : PSG Polytechnic College Z12303 Computer Organization DCS Question Paper Model : www.pdfquestion.in/6197.html

Instructions :
1. Group A and Group B questions should be answered in the Main Answer book.
2. Answer any TEN questions in Group A. Each question carries three marks.
3. Answer ALL questions either (a) subdivision or (b) subdivision in Group B. Each question carries 14 marks.

Z12304 C++ Programming
MODEL QUESTION PAPER
Time : 3 Hours Max. Marks: 100
Group – A Marks : 10 x 3 = 30
1. List the free store operators. What are the advantages of using free store operator over the function malloc()?
2. When you will make a function inline? Why?
3. In C++, a variable can be declared anywhere in the scope. What is the significance of this feature?

4. Compare structure and class.
5. Can data members of the class be initialized? Justify your answer.
6. What is a destructor and when is a destructor member function invoked in a class?

7. Specify the C++ operators that cannot be overloaded and that can be overloaded for unary and binary usages.
8. Define operator overloading. Write down the general form of operator overloading.

9. List the merits and demerits of function overloading over the conventional functional usages.
10. State the difference between compile time polymorphism and run time polymorphism.

11. The private members of a base class are not inheritable. Is it possible for the objects of a derived class to access the private members of a base class.? Justify your answer.
12. Describe the syntax of single inheritance. List its advantages.

13. Write statements using seekg() to achieve the following :
i) To move the pointer by 15 positions backward from current position.
ii) To go to the beginning after an operation is over.
iii) To go to byte number 50 in the file.

14. How is end of file detected in C++?
15. What is the difference between opening a file with constructor and opening a file with open() functions? When is one method preferred over the other?

Group– B :
Marks : 5 x 14 = 70
16. a) i) Write a C++ program to print all the numbers less than 200 and are divisible by 5 and 7 using for loops. (6)
ii) Explain the operators available only in C++ with examples. (8)
(OR)
b) Discuss the basic concepts of object oriented programming in detail. (14)

17. a) i)Define a class Teacher with the following class specification : private members: name 20 characters subject 10 characters Basic, DA, HRA float salary float Calculate( ) function computes the salary and returns it. salary is sum of Basic, DA and HRA public members: ReadData() function accepts the data values and invoke the calculate function. DisplayData() function prints the data on the screen. (7)

ii) With an example C++ program, explain dynamic initialization of objects using constructors. (7)
(OR)
b) i) Write a program to exchange the private values of two classes using friend function. (7)
ii) Constructors can be overloaded. Explain this concept with an example program. (7)

18.a) i) Explain the scope rules governing the function overloading. (5)
ii) Define a class named complex with two members real and imaginary of float data type. Create three Objects of class complex add two objects and store the result in third one. Use operator overloading to add two objects. (9) (OR)

b) i) Specify the rules for operator overloading. (6)
ii) Write a C++ program to find the square of a given number belonging to the three data types namely integers, floating point and double precision numbers using function overloading. (8)

19. a) i) Illustrate the effect of inheritance on the visibility of members of a class (6)
ii) Create a base class called “shape”. Use this class to store two double type values that is used to compute area of figures. Derive classes called “rectangle”, “triangle” and “circle” from the base “shape”.

Add member functions to the above classes to initialize to compute area and display area. Design a program that will accept dimensions interactively and display the area. (8)
(OR)

b) i) When do we make a virtual function “pure”? What are the implications of making a function a pure virtual function? (5)
ii) Write a C++ program to illustrate multiple inheritances. (9)

Leave a Reply

How to add comment : 1) Type your comment below. 2) Type your name. 3) Post comment.

www.pdfquestion.in © 2021

Contact Us   Privacy Policy   SiteMap