Sunday, 24 July 2011

PROGRAM IN C++ ON TOLL BOOTH

Do you like this post?
#include
#include


class booth
{
private:
int carno;
int amount;
static int count;

public:
void getdata( )
{
int I;
for (i=0;i<10;i++) { cout<< ”Enter the Car number”; cin>>carno;
cout<< ”Enter the Amount”; cin>> amount;
if (amount>0)
count++
}
}
void display( )
{
cout<<” Total Number of cars with paying amount”:< cout<” Total Number of cars without paying amount”:<<10-count;
}
};

Int booth::count;

void main( )
{
clrscr( );
booth b;
b.getdata( );
b.display( );
getch( );
}

No comments:

Post a Comment