Page 141 - DCAP404 _Object Oriented Programming
P. 141
Object-oriented Programming
Notes interest(int p=1000, int n, int r = 10);
};
interest::interest(int p=1000, int n, int r = 10)
{
principal = p; year = n; rate = r;
};
13. What is the purpose of having default arguments in a constructor? Explain with suitable
examples.
Answers: Self Assessment
1. object 2. void
3. const 4. Constructors
5. address 6. arguments
7. same 8. single
9. allocates 10. memory
11. objects 12. private
13. destructor 14. Parameterized
15. explicitly
6.11 Further Readings
Books E Balagurusamy; Object Oriented Programming with C++; Tata Mc Graw-Hill.
Herbert Schildt; The Complete Reference C++; Tata Mc Graw Hill.
Robert Lafore; Object-oriented Programming in Turbo C++; Galgotia.
Online links http://www.cprogramming.com/tutorial/constructor_destructor_ordering.html
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101 index.jsp?topic=
%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr374.htm
134 LOVELY PROFESSIONAL UNIVERSITY