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 or section
Like this
89Activity
0 of .
Results for:
No results containing your search query
P. 1
Obejct Oriented Programming Lab Manual

Obejct Oriented Programming Lab Manual

Ratings:

5.0

(4)
|Views: 5,016 |Likes:
Published by Ameen
Obejct Oriented Programming OOP Lab Manual, ECE 1201.
Obejct Oriented Programming OOP Lab Manual, ECE 1201.

More info:

Published by: Ameen on Sep 05, 2008
Copyright:Attribution Non-commercial

Availability:

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

05/20/2013

pdf

text

original

 
Lab Manual
For
Engineering Lab IIObject Oriented ProgrammingModuleECE 1201Semester I 2007/2008
Name: ____________________Student ID: ____________________Name of Instructor : ____________________
 
ECE 1201:Object Oriented Programming module
Version2.0
2
 
Table of ContentsGeneral Guidelines and Rules .................................. 6
Course Outline ...................................................... 11Chapter [1]: Introduction to OOP Lab ..................... 14Chapter [4]: Operator Overloading ......................... 52
Can you try to implement it as non-member function? (Hint: Refer to 4.6.2) Now,let’s see the last possibility which is:........................................................................62Can you guess whether we should implement it as member function or non-member function? Why?...........................................................................................634.6.4Overload insertion operator, <<.......................................................................63This section will try to eliminate print() member function that we have earlier byoverloading insertion operator, <<, but maintaining the purpose which is to printout the fraction object in this form of output, assume fraction object1(4,5), exampleof output: ..................................................................................................................634/5........................................................................................................................63Where do you normally use insertion operator, <<? Assume we have these lines of codes:........................................................................................................................64cout<< “I love programming.. it challenges my thinking capabilities..”;.................64What is the expected output? In dealing with class or user-defined data type, wehave to also overload this insertion operator when we want to use it with theobjects of our class. Like what we have done before, calling print() function fromobject a,....................................................................................................................64a.print();................................................................................................................64which prints out the object of a in terms of X/Y, we want to use the following line of code that produces the same output........................................................................64cout<<a;...............................................................................................................64Doesn’t it look simpler? Well, some issues that might arise here:............................641.In what way can we overload it? As member function or non-member friendfunction?....................................................................................................................642.What should be the arguments for operator<<() function?..................................643.What should be the return type?...........................................................................64Chapter [5]: Inheritance............................................................................................66Chapter [6]: Polymorphism.......................................................................................82
Appendix A: C++ Reserved Words ......................... 94Appendix B: ASCII Character Set ............................ 96References ........................................................... 97
3

Activity (89)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
brahmesh_sm liked this
Cutemiss Khalid liked this
suganthi31 liked this
vaishuraji2001 liked this
Seravana Kumar liked this
Armin Suljovic liked this

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)//-->