How To Exam?

a knowledge trading engine...


Himachal Pradesh University (HPU) 2011 B.C.A Computer Application C - Question Paper

Tuesday, 22 January 2013 02:50Web

Q.1.
(a) Mention the difference ranging from C and C++. Why is it necessary to include header files in a program written in these languages?

(b) explain the basic data kinds of C++. Suggest improper data kind for the following:
(1) Someone's height in meters
(2) An exclamation mark
(3) The number of students in a university

(c) What is the purpose of info hiding?

(d) Write a program, which will accept a string of maximum 10 characters from the keyboard, and count the occurrences of every of the five vowels in the string. The output should be in tabbed format as shown below:
A E I O U
0 one 0 0 1

Q.2
(a) Differentiate ranging from operator and function overloading with the help of suitable example.

(b) discuss the concept of a Destructor in a class. What is its role in terms of cleanup of unwanted objects?

Q.3.
(a) How is a exception handling performed in C++? Write a program that throws an arithmetic exception as and when a number input is greater than 9999.

(b) Write a C++ template function, called exchange ( ) that accepts 2 arguments of generic kind and swaps their contents.

Q.4.
(a) Write a C++ program to print reverse of a 5-digit number.

(b) discuss the concept of metadata.
Q.5.
describe the following:
(i) Polymorphism
(ii) Typecasting
(iii) Class and instance
(iv) Containership
(v) Abstract class



Q.1.
(a) Explain any five advantages of object Programming.

(b) Explain the need of inheritance and list any three advantages of it.

(c) Explain the purpose of the following with a suitable example of each:
(1) Use Case Diagram
(2) Interaction Diagram

(d) Write C++ code to create a class date. Using this class, calculate the age of a person as on the current date.

(e) List the various restrictions with operator overloading. Write a C++ program to illustrate the overloading of increment operator.

Q.2.
(a) Define the term exception handling. Write a program to raise an exception if an attempt is made to divide a number by zero.

(b) Give output of the following:
{
int a = 10, b=20,d;
d = b++;
cout <<d<<b;
d = ++a;
cout<<d<<a;
}

Q.3.
(a) Explain the purpose of function overloading. Write a C++ program that uses a function to check whether a given number is divisible by another number or not. Give proper comments whether the denominator number is a prime number or not.

(b) Explain briefly static data members.

Q.4.
(a) Define a friend function. Explain the relation of friend with respect to public. Private and Protected data members of the class.

(b) Write a C++ program to find the sum of all digits in a five-digit number. (For example, if given number is 12345 then the output is 1+2+3+4+5 = 15).

Q.5. Define the following with an example of each:
(i) this pointer
(ii) Distracter
(iii) Typecasting
(iv) Abstract class
(v) Parameterized Constructor

 


( 4 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Himachal Pradesh University (HPU) 2011 B.C.A Computer Application C - Question Paper