Mumbai University Previous year question papers Computer Programming II June 2008

Mumbai University Previous year question papers

I Year Examination June 2008

Computer Programming-II

N.B.(1) Ques~ion NO.1 is compulsory.

(2) Attempt any four questions out of remaining six questions.

1. ~(a) ExplainCall-by-Valueand Call-by-Reference with one programming example each.

(b) What will be the outp,utof the followingcode:

(i) #inc1ude < iostream.h >

int main ( )

{

int a=3 ;

” ” dl cou « « a « en .

,

cout «” “« (a++) « end I ;

 

cout «” “« (++a) « end I ;

return 0 ;

}

(ii) # inc1ude < iostream.h >

int main ( )

{

int x= 4, Y= 9 ;

int z ;

z = (x ++) + ( –y) 4-Y ;

cout

« uValue = U«Z « end I ;

z = ( – – x) + x + ( y – – ) ;

cout

«” value =Z « endl

;

return 0 ;

}

(Hi) .# include < iostream.h>

int main ( )

{

int a, b, c ;

a ::::2 ; b = 5 ; c = 10 ;

cout «” Value = U«(a + b*- c) « end I ;

cout «” Value

= “« ( c/b *c -a) « endl ;

cout «” Value = U« (

a + ++b%a) « endl ;

return 0 ;

2. (a) What is object-oriented programming? List basic concepts of it? Explain each  concept:

(b) Write a C++ program to check if the given number is “Armstrong Number”. An Armstrong number of 3 digits is an integer such that the sum of the cubes of its digits is equal to the no. itself.

3. (a) Explain &tprageclass with one programming example.

(b) Write a c: ++ program to display :- ‘

4. (C)Explain Bitwise operators in C++.

 

(b) ,Write a C++ program to read and display elements of a square matrix and then transpose the matrix. Use singletwodimensionalmatrixthroughout the program.

5. (a) ‘Explain recursion and write a recursive function for calculating factorial of a N number.

(b) Write a C++ program to find how many objects of a class has been created using static members function.

6. .(a) Write a C++ program to find volume of cube, cylinder and rectangle using method overloading.

(b) Define structure within structure consisting of following elements :-

(i) Employee code

 

(ii) Employeename

(iii) Employeesalary

and,

(iv) Employee date_of~oining Write a C++ program to read at least 10 records and display them.

7. (a) Write a program to generate Fibonacci series. ~

(b) Write a program to check whether given number is prime number or not and display respectively.
(c) Explain difference between declaration and defination.

(d) Explain the concept of constructor and Destructor

Leave a Comment