Example - Stocks


You work for Business Software Inc. They have been contracted by a client who is in the business of buying and selling stocks. You have been assigned to come up with some different designs for the class: TheStock whose attributes are to be:

image from book

 stockName, stockID and stockPrice. 

image from book

This class should be able to use some of the overloaded operators to make the handling of this class more efficient.

  1. stock1.cpp This program demonstrates the overloading of a relational operator.

  2. stock2.cpp This program demonstrates input and output by overloading << and >>

  3. stock3.cpp This program demonstrates input and output by overloading << and >> where the >> operator is connected to an external text file: stock.txt

  4. stock4.cpp This program demonstrates input and output by overloading << and >> where both operators are used by cout and the << operator is connected to an external text file.




Intermediate Business Programming with C++
Intermediate Business Programming with C++
ISBN: 738453099
EAN: N/A
Year: 2007
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net