Basically this is a homework assisgnment. So it is a .dat file about football. Their teams, scores etc. Now he wants us to filter and display some things. Would be a comment on what I have to do. Not sure how to go about everything though. Could someone please help me out?
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
usingnamespace std;
//1) Which teams in the NFC conference, East division had winning records? (wins > loses)
//2) Which team scored the most points?
//3) Which team gave up the fewest points?
//4) What was the total number of wins for all of the teams in the league, and what was the total number of loses?
int main() {
ifstream infile;
string file = "NFL.dat";
string city, name, con, div, winteam;
int win, lose, tie, pos, neg;
infile.open("NFL.dat");
if (infile.is_open())
{ cout << "sucessfully open" << endl;;
}
while ( infile >> city >> name >> con >> div >> win >> lose >> tie >> pos >> neg)
{ cout << city << setw(7) << name << setw(4) << con << setw(4) << div << setw(4) << win << setw(4) << lose << setw(4) << tie << setw(4) << pos << setw(4) << neg << endl;
}
if (con == "NFC" && div == "EAST")
{ winteam;
}
infile.close();
cout << winteam;
return 0;
}
I was testing it out but doesn't display anything for the winteam. Thought it at least give me the whole thing.