#include <iostream>
#include <string>
using namespace std;

class GuessAccount
{ 
private:
	string guestname;
	int guestid;
	double internetbill;
	string entrydate;
	int nodays;
	int noguest;
	double presentfees;
	double totalfees;
public:

	void setguestname();
	void setguestid();
	void setinternetbill();
    void setentrydate();
	void setnodays();
	void setnoguest();
	void setpesentfees();
	void settotalfees();
    void displayinfo();
};
//implementation section
void GuessAccount::setguestname()
{
	cout<<"Enter Guess Name ";
	cin>>guestname;
}
void GuessAccount::setguestid()
{
	cout<<"Enter Guest ID Number ";
	cin>>guestid;
}
void GuessAccount::setinternetbill()
{
	cout<<"Enter Internet Bill ";
	cin>>internetbill;
}
void GuessAccount::setentrydate()
{
	cout<<"Enter Entry Date ";
	cin>>entrydate;
}
void GuessAccount::setnodays()
{
	cout<<"Enter Number of Days ";
	cin>>nodays;
	if (nodays>1 && nodays<30)
		cout <<"Valid";
	else
		cout<<"Not Allowed ";

}
void GuessAccount::setnoguest()
{
	cout<<"Enter Number of Guest";
	cin>>noguest;
}
void GuessAccount::setpresentfees()
{
	cout<<"Enter Pressent Fees";
	cin>>presentfees;
	presentfees=350*nodays;
}
void GuessAccount::settotalfees()
{
	cout<<"Enter Total Fees ";
	cin>>totalfees;
	totalfees=internetbill+presentfees;
}
void GuessAccount::displayinfo()
{
	cout<<"Guess Name: "<<guestname<<endl;
	cout<<"Guest ID Number: "<<guestid<<endl;
	cout<<"Internet Bill: "<<internetbill<<endl;
	cout<<"Entry Date: "<<entrydate<<endl;
	cout<<"Number of Days: "<<nodays<<endl;
	cout<<"Number of Guest: "<<noguest<<endl;
	cout<<"Present Fees: "<<presentfees<<endl;
	cout<<"Total Fees: "<<totalfees<<endl;
}

int main()
{
	GuessAccount aGuessAccount;
	aGuessAccount.setguestname();
	aGuessAccount.setguestid();
	aGuessAccount.setinternetbill();
	aGuessAccount.setentrydate();
	aGuessAccount.setnodays();
	aGuessAccount.setnoguest();
	aGuessAccount.setpresentfees();
	aGuessAccount.settotalfees();
	aGuessAccount.displayinfo();

	cin.get();
	return 0;

}

i need to instantiate one of the objects HELP

Edited 6 Years Ago by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

This article has been dead for over six months. Start a new discussion instead.