confused about a program?

hi. i need help with my program. i have started it but im stuck and dont know what to do. im a beginner at this and not sure what im doing. i have to program statistics for 8 teams. i have to write the number of wins, losses, ties, final score and winning average. i am not not sure where i have to put the data for the first team and what do i have to do so that it repeats for the rest of the teams. thanks a lot.

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int idnumb, wins, losses, tied, totalgames, remaininggames, finalscore;
double winningaverage;

//the program will print out the statistics for eight football teams
cout<<"first football team's id number"<< endl;
cin>>idnumb;
while(idnumb>=0) {
cout<<"the number of games won are"<< endl;
cin>>wins;
cout<<"the number of games lost are"<< endl;
cin<<losses;
cout>>"the number of games tied are"<< endl;
cin<<tied;
cout<< "the number of total games played are"<< endl;
cin>>totalgames=(wins+losses+tied);
if (wins+losses+tied==16)
cout<<"the season is finished"<< endl;
else (wins+losses+tied<16)
cout<<"the season is not finished"<< endl;
cout<< "the winning average is"<< endl;
cin>>winningaverage=(wins/totalgames);
if (tied>=tied)
cout<<"number of games tied is greater than or equal to the number of games won"<< endl;
else (tied>losses)
cout<< "number of games tied is not greater than the number of games lost"<< endl;
}
cout<<'stop';
return 0;
}
Please use code tags >.<
But your first problem is while(idnumb>=0) You never change idnumb - so it will be in a infinite loop plus when you get it cin>>idnumb wouldnt it be bigger than 0 ?
Also you're misusing = (= is assignment operator while == compares)
EDIT: Nvm you werent misusing = :p
But what are you trying to do by cin>>winningaverage=(wins/totalgames);?
Last edited on
Hello Angeljruiz!!! you are saying right.... i think this help will better for him...
thanks but im new to this and dont know what code tags are. what should i do with idnumb. i have to so 8 teams so how can i make it stop at 8 because the numbers are made up.
Topic archived. No new replies allowed.