all I am trying to do below is to add my s's and divid
them by 2 and adding my m's
and then adding the s's and m's together
but it is only givining me one person
can you tell me why??
thanks
#include<iostream.h>
#include<ctype.h>
//function prototypes
void main()
{
char what=' ';
char who[25]={0};
float scount=0;
float mcount=0;
float tcount=0;
cout<<"Enter S for scout or M for any adults: "<<endl;
cin>>what;
while (toupper(what !='x'))
{
cout<<"Enter First name of person going on Campout: "<<endl;
cin>>who;
cout<<"Enter S for scout or M for any adults: "<<endl;
cin>>what;
}
what=toupper(what);
if(what=='s')
scount=(scount+1)/2;
else
if(what=='m')
mcount=mcount+1;
tcount=scount+mcount;
cout<<what<<who<<endl;
cout<<"Here is your tent count: "<<tcount<<endl;
}
them by 2 and adding my m's
and then adding the s's and m's together
but it is only givining me one person
can you tell me why??
thanks
#include<iostream.h>
#include<ctype.h>
//function prototypes
void main()
{
char what=' ';
char who[25]={0};
float scount=0;
float mcount=0;
float tcount=0;
cout<<"Enter S for scout or M for any adults: "<<endl;
cin>>what;
while (toupper(what !='x'))
{
cout<<"Enter First name of person going on Campout: "<<endl;
cin>>who;
cout<<"Enter S for scout or M for any adults: "<<endl;
cin>>what;
}
what=toupper(what);
if(what=='s')
scount=(scount+1)/2;
else
if(what=='m')
mcount=mcount+1;
tcount=scount+mcount;
cout<<what<<who<<endl;
cout<<"Here is your tent count: "<<tcount<<endl;
}