B.TECH - Semester 4 computer programming Question Paper 2022 (dec)
Practice authentic previous year university questions for better exam preparation.
Sample Questions
- What is (ne difference between Call by Value and Call by Reference?
- Explain the use of if stream and of stream classes [or file input and outpul.
- Explain the OOP's concapts Dala Hiding and Dala Encapsulation
- Whal are enumeraled dala lypes?
- What are the differences between structure and union?
- Explain the visibility of base class members for the access speciliers: privale, prolected and public while crealing the derived class.
- What is Inherilance? Whal are the advantages of Inherilance?
- Differentiate STACK and QUEUE.
- List out the operalors that cannot be overloaded. $$ \text { ( } 10 \times 2=20 \text { Marks) } $$ Answer any one full question from each module. Each question carriers 20 marks.
- (a) Explain any four string manipulation funclions in C++. 8
- (b) Write a Program lo read a string and count number of vowels in it. 6
- (c) Write a program that reverses the digils of a given posilive integer. 6
- (a) What is storage class? Explain various storage classes in C++ 4
- (b) Write a C++ program that solves quadratic equations. 8
- (c) Write a program that reads $n$ inlegers and prinls lhe minimum and maximum inleger among them.
- (a) With the help of suitable example explain the array of pointers and pointers lo array concept.
- (b) Create three objects of class STRING $\mathrm{si}, \mathrm{si}, \mathrm{si}$ as shown below : STRING s1 = "UNIVERSITY OF" STRING s2 = KERALA STRING s3: Write a Che program to do the following operalions.
- (i) Copy the contents of s1 lo s3 (ii) Find a sub-string from s1. For example "Si|TY" (iii) Compare $s 1$ and $s 2$.
- (a) (ii) State the important leatures of object oriented programming. (ii) Compare object arienled programming wilh procedure orienled programming.
- (b) A leap year is a year in which one extra day (February 29) is added to the regular calendar. Most of us know that the leap years are the years that are divisible by 4. For example, 1992 and 1996 are leap years. Mosl people, however, do not know t...
- (a) Define runclion overfoading. Wrile a C++ program to define three overloaded runctions lo swap two Inlegers, swap two floals and swap two doubles.
- (b) What is run time palymorphism? How virtual funclions can be used to implement the run time polymorphism? Explain with the help of an example.
- (a) Wrile a C+= program lo creale a base class called STUDENT (Name, Roll Number, Age) and using inherilance creale classes UG Sludent and PG Student having fields as semester, tees and stipend. Enter the dala of 6 students. Find the average age, sem...
- (b) List the characlenslics of a friend function.
- (c) Wrile a C++ program to count number of lines and words in a file.
- (a) Write the algorithm to sort the given sel of records using selection sort, Illustrate the intermediate results of the selection sort lo sort the given set of Inlegers: $35,16,18,9,15,45,39,95,40,8$,
- (b) Write an algorillam to Inserl an teem at the end of the singly linked fist and delele an arbilrary ilem from the singly linked lisl 18 (a) Given two linked list represenlation of polynomials P1 and P2. Wrile a C++ program lo perform the followin...
- (i) $\mathrm{P} 3=\mathrm{P} 1-\mathrm{P} 2$ (ii) $\mathrm{P} 4=\mathrm{P} 1 \times \mathrm{P} 2$
- (b) Write an algoritim to sort the given sel or n numbers using Insertion sori. B $\{4 \times 20=80$ Marks $\}$