Assignment 6 Extra Credit Opportunities
3-6 points available / due 11/3 1:30 pm (the usual time)
These
extra credit options are available only to students who turned in
assignment 6 early (by midnight, Monday 11/2) and receive a grade of 19
or 20 points). The intent of this opportunity is to challenge
students who are motivated to learn more about the current topics.
1. (4 points available)
Add another class, called NFL_Teams that looks like this:
class NFL_Teams
{
private:
NFL_Team** teams;
void getNFL_Teams();
// make the function private and have
it called by the constructor
int search(string teamname) const; // make this function private
void sortArray ();
// make this function private
public:
NFL_Teams(const string& teamsfilename); // constructor
~NFL_Teams();
// destructor
void processGames(const string& scoresfilename);
void printTeams() const;
void printStandings() const;
...
};
Change main to this:
const string Teamsfilename = ...
const string Scoresfilename = ...
int main()
{
NFL_Teams teams(Teamsfilename);
teams.processGames(Scoresfilename);
teams.printStandings();
}
2. (1 point available)
Add constructor initializers to each of the constructors
3. (1 point available)
Answer these questions
- What is the effect of making member functions private and why would you want to do this?
- Why is this a better design, or is it?.