Nr220504-Object Oriented Programming
Nr220504-Object Oriented Programming
2
II B.Tech II Semester Supplimentary Examinations,February 2010
OBJECT ORIENTED PROGRAMMING
Common to Information Technology, Electronics And Computer
Engineering, Computer Science And Engineering, Computer Science And
Systems Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????
2. (a) Write a program for checking the type of a class with dynamic cast.
(b) Write a program for changing pointer types with dynamic-cast. [8+8]
3. (a) Write a program to show how to define and declare a class which consists of
both virtual members and virtual destructors under multiple inheritance.
(b) Consider a bank maintains two kinds of accounts for customers savings ac-
count and current account. The savings account provides compound interest
and withdrawal facilities but no cheque facility. The current account pro-
vides cheque book facility but no interest. Create a class account that stores
customer name, account number and type of account. From this derive the
classes cur acct and sav acct to make them more specific to their require-
ments. Include necessary member functions in order to achieve the following
tasks:
i. Accept deposit from a customer and update the balance.
ii. Display the balance.
iii. Compute and deposit interest.
iv. Permit withdrawal and update the balance.
Use member functions to initialize the class members. [8+8]
5. Discuss the software design trends with merits and demerits. [16]
6. (a) Write a function count letter that takes a single character. This function
will count the number of consonants and vowels. If a nonletter is given to the
function, it generates an exception
(b) How does the throw differ from return? [10+6]
1
Code No: 14027 NR Set No. 2
7. (a) What is recursion? Give recursive definitions for GCD of two numbers and
for factorial of a number.
(b) Compare recursion with iteration.
(c) Write a C program that reads a character array and gives frequency count of
each character. [6+3+7]
?????
2
Code No: 14027 NR Set No. 4
II B.Tech II Semester Supplimentary Examinations,February 2010
OBJECT ORIENTED PROGRAMMING
Common to Information Technology, Electronics And Computer
Engineering, Computer Science And Engineering, Computer Science And
Systems Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????
1. (a) Write a program for checking the type of a class with dynamic cast.
(b) Write a program for changing pointer types with dynamic-cast. [8+8]
3. (a) Write a program to show how to define and declare a class which consists of
both virtual members and virtual destructors under multiple inheritance.
(b) Consider a bank maintains two kinds of accounts for customers savings ac-
count and current account. The savings account provides compound interest
and withdrawal facilities but no cheque facility. The current account pro-
vides cheque book facility but no interest. Create a class account that stores
customer name, account number and type of account. From this derive the
classes cur acct and sav acct to make them more specific to their require-
ments. Include necessary member functions in order to achieve the following
tasks:
i. Accept deposit from a customer and update the balance.
ii. Display the balance.
iii. Compute and deposit interest.
iv. Permit withdrawal and update the balance.
Use member functions to initialize the class members. [8+8]
3
Code No: 14027 NR Set No. 4
(b) How do friend operator functions differ from member operation functions?
(c) Implement passing of objects to function with an example. [6+4+6]
5. Discuss the software design trends with merits and demerits. [16]
7. (a) What is recursion? Give recursive definitions for GCD of two numbers and
for factorial of a number.
(b) Compare recursion with iteration.
(c) Write a C program that reads a character array and gives frequency count of
each character. [6+3+7]
8. (a) Write a function count letter that takes a single character. This function
will count the number of consonants and vowels. If a nonletter is given to the
function, it generates an exception
(b) How does the throw differ from return? [10+6]
?????
4
Code No: 14027 NR Set No. 1
II B.Tech II Semester Supplimentary Examinations,February 2010
OBJECT ORIENTED PROGRAMMING
Common to Information Technology, Electronics And Computer
Engineering, Computer Science And Engineering, Computer Science And
Systems Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????
5
Code No: 14027 NR Set No. 1
(b) Compare recursion with iteration.
(c) Write a C program that reads a character array and gives frequency count of
each character. [6+3+7]
6. Discuss the software design trends with merits and demerits. [16]
8. (a) Write a function count letter that takes a single character. This function
will count the number of consonants and vowels. If a nonletter is given to the
function, it generates an exception
(b) How does the throw differ from return? [10+6]
?????
6
Code No: 14027 NR Set No. 3
II B.Tech II Semester Supplimentary Examinations,February 2010
OBJECT ORIENTED PROGRAMMING
Common to Information Technology, Electronics And Computer
Engineering, Computer Science And Engineering, Computer Science And
Systems Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????
1. Discuss the software design trends with merits and demerits. [16]
3. (a) What is recursion? Give recursive definitions for GCD of two numbers and
for factorial of a number.
(b) Compare recursion with iteration.
(c) Write a C program that reads a character array and gives frequency count of
each character. [6+3+7]
4. (a) Write a function count letter that takes a single character. This function
will count the number of consonants and vowels. If a nonletter is given to the
function, it generates an exception
(b) How does the throw differ from return? [10+6]
6. (a) Write a program for checking the type of a class with dynamic cast.
(b) Write a program for changing pointer types with dynamic-cast. [8+8]
7
Code No: 14027 NR Set No. 3
7. (a) Write a program to show how to define and declare a class which consists of
both virtual members and virtual destructors under multiple inheritance.
(b) Consider a bank maintains two kinds of accounts for customers savings ac-
count and current account. The savings account provides compound interest
and withdrawal facilities but no cheque facility. The current account pro-
vides cheque book facility but no interest. Create a class account that stores
customer name, account number and type of account. From this derive the
classes cur acct and sav acct to make them more specific to their require-
ments. Include necessary member functions in order to achieve the following
tasks:
i. Accept deposit from a customer and update the balance.
ii. Display the balance.
iii. Compute and deposit interest.
iv. Permit withdrawal and update the balance.
Use member functions to initialize the class members. [8+8]
?????