#include <iostream>
using namespace std;
class BigNum
{
private :
int biggest;
void determineBiggest ( int num)
{
if (num > biggest)
biggest = num ;
}
public :
BigNum ()
{
biggest = 0 ;
bool examineNum(int);
int getBiggest()
{
return biggest;
}
};
bool BigNum::examineNum(int n)
{
bool goodValue = true ;
if (n>0)
determineBiggest(n);
else
goodValue = false;
return goodValue;
}
void getNumbers(BigNum&);
int main()
{
Bignum stockShares;
cout <<" This program determines which stock purchase involved\n"
<<" the largest number of shares of stock. \n\n " ;
getNumbers(stockShares);
cout << "\n The largest number of shares bought was " << stockShares.getBiggest()<<".\n";
return 0;
}
void getNumbers(BigNum &stock)
{
int NumTrans,
NumShares;
cout << " How many stock purchases have you made this month ? " ;
cin >> numTrans;
for ( int trans = 1; trans <=numTrans; trans++)
{
cout << " Purchase " << trans<< "shares purchased : " ;
cin>> numShares;
while (!stock.examineNum(numShares))
{
cout<< " The number entered should be greater than 0.\n "
<< " Re-enter the number of stock shares purchased : ";
cin >> numShares;
}
}
}
Error 1 error C2535: 'void BigNum::getNumbers(BigNum &)' : member function already defined or declared c:\users\se7olutionyg\documents\visual studio 2008\projects\nau\nau\nau.cpp 47 Nau
Error 2 fatal error C1075: end of file found before the left brace '{' at 'c:\users\se7olutionyg\documents\visual studio 2008\projects\nau\nau\nau.cpp(5)' was matched c:\users\se7olutionyg\documents\visual studio 2008\projects\nau\nau\nau.cpp 66 Nau
there are erros , can anybody help me with that?