#include<iostream.h>
#include<conio.h>
class M
{
public:
int c1,c2,t1,t2,i,x;
M();
void check();
void show();
};
M::M()
{
i=0;
t1=0;
c1=0;
c2=0;
}
void M::check()
{
cout<<"\t\t\twelcome to movie counter\n ";
cout<<"do you want to get ionside\n";
while(i<10)
{
cout<<"if you have ticket pres 1 for pass press 2\n";
cin>>x;
if(x==1)
{
cout<<"price is 250\n";
t1=t1+250;
c1++;
}
else if (x==2)
{
cout<<"you dont need ticket go inside\n";
cout<<"\t\t\t have fun\n";
c2++;
t2++;
}
else
{
cout<<"wrong option\n";
}
i++;
}
}
void M::show()
{
cout<<"total people\t"<<(c1+c2)<<"\n";
cout<<"total tickets\t"<<c1<<"\n";
cout<<"total pass\t"<<c2<<"\n";
cout<<"total income\t"<<t1<<"\n";
}
void main()
{
clrscr();
M m1;
m1.check();
m1.show();
getch();
}
#include<conio.h>
class M
{
public:
int c1,c2,t1,t2,i,x;
M();
void check();
void show();
};
M::M()
{
i=0;
t1=0;
c1=0;
c2=0;
}
void M::check()
{
cout<<"\t\t\twelcome to movie counter\n ";
cout<<"do you want to get ionside\n";
while(i<10)
{
cout<<"if you have ticket pres 1 for pass press 2\n";
cin>>x;
if(x==1)
{
cout<<"price is 250\n";
t1=t1+250;
c1++;
}
else if (x==2)
{
cout<<"you dont need ticket go inside\n";
cout<<"\t\t\t have fun\n";
c2++;
t2++;
}
else
{
cout<<"wrong option\n";
}
i++;
}
}
void M::show()
{
cout<<"total people\t"<<(c1+c2)<<"\n";
cout<<"total tickets\t"<<c1<<"\n";
cout<<"total pass\t"<<c2<<"\n";
cout<<"total income\t"<<t1<<"\n";
}
void main()
{
clrscr();
M m1;
m1.check();
m1.show();
getch();
}
No comments:
Post a Comment