my program wont loop


#include <iostream>
using namespace std;
int isitvalidgroup(int,int,int);
int classify(int,int,int);
int rateonescore(int);
int findtotalscore(int,int,int);
int ratethegroup(int,int,int,int);
int main()
{int a,b,c,y;
cout<<"You will be asked to enter three SAT scores. ";
cout<<"If you enter three -1 scores your program will end"<<endl;
cout<<"Enter first Sat Score. "<<endl;
cin>>a;
cout<<"Enter Second Sat Score. "<<endl;
cin>>b;
cout<<"Enter Third Sat Score. "<< endl;
cin>>c;
cout<<"You have Entered "<<a<<" "<<b;
cout<<" and "<<c<<endl;{
while (!(a>0&&b>0&&c>0)
)y=isitvalidgroup(a,b,c)
;if (y==2)
cin>>a>>b>>c;
else
classify(a,b,c);
cout<<endl<<endl;
cout<<" Enter Three More Values "<<endl;
cin>>a>>b>>c; }
system("PAUSE");
return 0;
}









int rateonescore(int r)
{ if (r<500)
cout<<r<<" is less than 500 "<<endl;
if (r==500)
cout<<r<<" is equal to 500 "<<endl;
if (r>500)
cout<<r<<" is greater than 500 "<<endl;
}
int findtotalscore(int f,int g,int h)
{ int total;
total=f+g+h;
cout<<total<<" is the total of "<<f<<" + "<<g<<" +"<<h<<endl;
return total;
}
int ratethegroup(int v,int b,int n, int m)
{
if (m>=2100&&v>700&&b>700&&n>700)
cout<<" Outstanding "<<endl;
else
if (m>=2100&&v+b>=1400 || v+n>=1400 || b+n>=1400)
cout<<" very good "<<endl;
else
if (m>=2100 && v+b>1400&&n>700||v+n<1400&&b>700||n+b<1400&&v>700)
cout<<"lop-sided"<<endl;
else
if (m<2100 &&v>500&&b>500&&n>500)
cout<<"weak"<<endl;
else
cout<<"erratic"<<endl;
}
int isitvalidgroup(int z,int x,int c)
{
if (z<200 && z>800)
cout<<z<<" is invalid"<<endl;
if (x<200 && x>800)
cout<<x<<" is invalid"<<endl;
if (c<200 && c>800)
cout<<c<<" is invalid"<<endl;
if (z<200 && z>800 && x<200 && x>800 && c<200 && c>800)
return 1; // 1 will be true and 2 will be false
else
return 2;
}

int classify(int q,int w,int e)
{ int a,b,c,d;
rateonescore(q);
rateonescore(w);
rateonescore(e);
a=findtotalscore(q,w,e);
ratethegroup(q,w,e,a);
return 0;
}
please help me figure out why this wont loop
anyone have an idea?
??????????????????
Maybe if you used code tags
[code][/code]
and waited more than 5-20 minutes before bumping people would be more willing to help.
Also if you didn't double post 5 minutes later.
http://www.cplusplus.com/forum/beginner/127107/
Last edited on
ok
Topic archived. No new replies allowed.