Cs 72 (p)s2

778 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
778
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cs 72 (p)s2

  1. 1. No. of Printed Pages : 2 SET-2 BACHELOR IN COMPUTER APPLICATIONS (BCA) Term-End Practical Examination 00806 June, 2011 CS-72P : C++ AND OBJECT ORIENTED PROGRAMMINGTime allowed : 2 hours Maximum Marks : 100 (Weightage : 15%)General Instructions :(i) There are two compulsory questions in this paper of 40 marks each. Rest 20 marks are for viva-voce.(ii) You must write the appropriate main( ) function and test your programs.(iii) Write/print the programs, input and results on your answer-script.(iv) Make and state suitable assumptions, if any.1. Design and implement a class using C + + that stores a real number as integer mantissa 40 and exponent. For example, the number — 2.345 x 105 will be represented as : — 2345 x 102 Mantissa (Integer) — 2345 Exponent 2 The class should have a constructor that takes integer mantissa and exponent value to create the object of the real number class. The class should also include an overloaded x (multiply) operator; and a member function that prints the stored number as : "Mantissa : — 2345 Exponent : 2 "2. Consider the following hierarchy along with the suggested data members of the 40 classes : Data members • Customer ID Telephone Customers • Customer - Name • Credit - Limit • Year of becoming customer Cellphone Customers Land Line Customer • Mobile ID • Address • Internet use limitCS-72P/S2 1 P.T.O.
  2. 2. Design and implement the classes in the hierarchy using C + + . You may add more data members in the classes. You should include at least one constructor in each class. Also include a member function print_customer_info ( ) in each class that prints all the information of the object of that class. You should demonstrate polymorphism using this print_custormer_info ( ) function and appropriate main ( ) function.CS-72P/ S2 2 4,000

×