Help with this plz!

Create a class based on TMoney. TMoney only contains three denominatio

Page 1 of 1

1 Replies - 221 Views - Last Post: 16 December 2009 - 02:56 PM Rate Topic: -----

#1 inkashimi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-December 09

Help with this plz!

Posted 16 December 2009 - 02:46 PM

i know this question has already been asked but i still don't get it this is what i have:

#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(TMoney money);        
	int getTDollars(){return tdollars;}        
	void setTDollars(int tdollars);       
	int getTWons(){return twons;}        
	void setTWons(int twons);        
	int getTPennies() {return tpennies;}        
	void setTPennies(int tpennies);
};int main()
{        
	TMoney money[3];
	for (int jj = 0; jj < 3; jj++)
	{
		money[jj].inputData();
	}
	{        
		int tdollars;        
		cout <<"Enter how many tdoallars you own.";        
		cin >> tdollars;        
		setTDollars;        
		int twons;        
		cout <<"Enter how many twons you own.";        
		cin >> twons;        
		setTWons;        
		int tpennies;        
		cout << "Enter how many tpennies you own.";        
		cin >> tpennies;        
		setTPennies;
	}
	void TMoney::outputData(TMoney money);
	{
		tdollars = getTDollars();        
		twons = getTWons();        
		tpennies = getTPennies();        
		cout << "You have tdollars," << TDollars << " twons," << TWons <<" tpennies." << TPennies << endl;
	}


*** MOD EDIT: Added code tags. Please :code: ***

This post has been edited by JackOfAllTrades: 16 December 2009 - 02:56 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Help with this plz!

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: Help with this plz!

Posted 16 December 2009 - 02:56 PM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1