Hey guys, I am tying to get my program to work, I don't have any errors but I cant get an output from it. I am supposed to output the second set of three from the nine inputs. Thanks to those who reply.
#include <iostream>
using namespace std;
class TMoney
{
private:
int tdollars;
int twons;
int tpennies;
int MONEY;
int TDollars,TWons,TPennies;
public:
TMoney():tdollars(0),twons(0),tpennies(0){}
void inputData();
void outputData();
int getTDollars(){return tdollars;}
void setTDollars(int td){tdollars = td;}
int getTWons(){return twons;}
void setTWons(int tw){twons = tw;}
int getTPennies() {return tpennies;}
void setTPennies(int tp){tpennies = tp;}
};
int main()
{
TMoney money[3];
money[0].inputData();
money[0].outputData();
return 0;
}
void TMoney::inputData()
{
int j;
for (j=0;j<3;j++)
{
int td;
cout <<"Enter how many tdoallars you own.";
cin >> td;
setTDollars(td);
int tw;
cout <<"Enter how many twons you own.";
cin >> tw;
setTWons(tw);
int tp;
cout << "Enter how many tpennies you own.";
cin >> tp;
setTPennies(tp);
}
}
void TMoney::outputData()
{
int m;
for(m=0;m<MONEY;m++)
{
tdollars = getTDollars();
twons = getTWons();
tpennies = getTPennies();
cout << "You have ," << TDollars << " tdollars," << TWons <<" twons." <<"and"<< TPennies << "tpennise"<<endl;
}
}