Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
4Activity
0 of .
Results for:
No results containing your search query
P. 1
Nr220504-Object Oriented Programming

Nr220504-Object Oriented Programming

Ratings: (0)|Views: 581|Likes:
Published by SRINIVASA RAO GANTA

More info:

Published by: SRINIVASA RAO GANTA on Feb 25, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/26/2012

pdf

text

original

 
Code No: 14027
NR Set No. 2
II B.Tech II Semester Supplimentary Examinations,February 2010OBJECT ORIENTED PROGRAMMINGCommon to Information Technology, Electronics And ComputerEngineering, Computer Science And Engineering, Computer Science AndSystems EngineeringTime: 3 hours Max Marks: 80Answer any FIVE QuestionsAll Questions carry equal marks
    
1. (a) Write a C++ program to overload +, -, * operators for complex numbers.(b) How do friend operator functions differ from member operation functions?(c) Implement passing of objects to function with an example. [6+4+6]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 interestand withdrawal facilities but no cheque facility. The current account pro-vides cheque book facility but no interest. Create a class account that storescustomer name, account number and type of account. From this derive theclasses cur acct and sav acct to make them more specific to their require-ments. Include necessary member functions in order to achieve the followingtasks: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]4. (a) Write a short notes on different types constructors and destructors.(b) Differentiate between default constructor and other constructors with exam-ple.(c) Explain the various access speciers with an example. [5+6+5]5. Discuss the software design trends with merits and demerits. [16]6. (a) Write a function
count letter
that takes a single character. This functionwill count the number of consonants and vowels. If a nonletter is given to thefunction, 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 andfor 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) Answer the following:i. Write the declarator for the overloaded
>>
operator that takes outputfrom an object of class
istream
and displays it as the contents of anobject of class
Sample
.ii. Used with
cin,
what does the
skipws
flag accomplishiii. Write a statement that moves the current position 13 bytes backward ina stream object called
1.Write a statement that will create an object called
salefile
of the
ofstream
class and associate it with a file called SALES.JUN.(b) Write a program that allows the input of names and ages from the keyboardand stores them, in characters, in the file PEOPLE.DAT. After the input isfinished, the program should printout what is in the file as well as the averageage? [9+7]
    
2
 
Code No: 14027
NR Set No. 4
II B.Tech II Semester Supplimentary Examinations,February 2010OBJECT ORIENTED PROGRAMMINGCommon to Information Technology, Electronics And ComputerEngineering, Computer Science And Engineering, Computer Science AndSystems EngineeringTime: 3 hours Max Marks: 80Answer any FIVE QuestionsAll 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]2. (a) Answer the following:i. Write the declarator for the overloaded
>>
operator that takes outputfrom an object of class
istream
and displays it as the contents of anobject of class
Sample
.ii. Used with
cin,
what does the
skipws
flag accomplishiii. Write a statement that moves the current position 13 bytes backward ina stream object called
1.Write a statement that will create an object called
salefile
of the
ofstream
class and associate it with a file called SALES.JUN.(b) Write a program that allows the input of names and ages from the keyboardand stores them, in characters, in the file PEOPLE.DAT. After the input isfinished, the program should printout what is in the file as well as the averageage? [9+7]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 interestand withdrawal facilities but no cheque facility. The current account pro-vides cheque book facility but no interest. Create a class account that storescustomer name, account number and type of account. From this derive theclasses cur acct and sav acct to make them more specific to their require-ments. Include necessary member functions in order to achieve the followingtasks: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]4. (a) Write a C++ program to overload +, -, * operators for complex numbers.3

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->