



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
it has questions from previous year from 2011 to help you study
Typology: Exercises
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















Time allowed : 3 hours Maximum Marks: 70
General Instructions :
Question.1. (a) What is the difference between Local Variable and Global Variable? Also, give suitable C++ code to illustrate both. Answer: Local Variables : Local variables are those variables which are declared within a function or a compound statement and these variables can only be used within that function/scope. Global Variables : Global variables are those variables which are not declared within any function or scope. So, these variables can be accessed by any function of the program. Example:
(b) Write the names of the header files, which is/are essentially required to run/execute the following C++ code:
(d) Find the output of the following program :
Answer:
(e) Find the output of the following program:
Answer:
Question.2. (a) Differentiate between members, which are present within the private visibility mode with those which are present within the public visibility modes. Answer: Private members of a class are accessible only to the member functions of the same class. Public members of a class are accessible to the member functions of the same class, member functions of its derived classes and also to an object of the” class. Example:
(b) Write the output of the following C++ code. Also, write the name of. feature of Object Oriented Programming used in the following program jointly illustrated by the functions [I] to [IV].
Remarks are shown as follows:
Public members
Answer:
(d)Answer the question (i) to (iv) based on the following:
Answer:
Question.3.(a) Write a GetlFrom2( ) function in C++ to transfer the content from two arrays FIRST[ ] and SECOND[ ] to array ALL[ ]. The even places (0, 2,4,…) of array ALL[ ] should get the content from the array FIRST [ ] and odd places (1,3,5,…) of the array ALL [ ] should get the content from the array SECOND[ ]
Answer:
(b) An array P[20] [50] is stored in the memory along the column with each of its element occupying 4 bytes, find out the location of P[15] [10], if P[0] [0] is stored at 5200. Answer:
(e) Evaluate the following postfix notation of expression: 50, 60, +,20, 10, -,
Answer:
Question.4. (a) Observe the program segment given below carefully and fill the blanks marked as Statement 1 and Statement 2 using seekg( ), seekp( ), tellp() and tellgO functions for performing the required task.
(c) Write a function in C++ to search for a laptop from a binary file “LAPTOP.DAT” containing the objects of class LAPTOP (as defined below). The user should enter the Model No and the function should search and display the details of the laptop.
Answer:
Question.5.(a) What do you understand by Union & Cartesian Product operations in relational algebra? Answer: The union of two relations is a relation that includes all the tuples that are either in R or S or in both R and S. The Cartesian Product combines the tuples of one relation with all the tuples of the realtion. Consider the following tables WORKER and PAYLEVEL and answer (b) and-(c) parts of this question: