Question: c++ cplus clpus.. there is a example code at the bottom to get an idea of how to get started DIRECTIONS: As designed, the class
c++ cplus clpus.. there is a example code at the bottom to get an idea of how to get started

DIRECTIONS:
As designed, the class FootballTeam holds two strings, six integers and an enumerated value. The strings hold the city where the football team plays and the name of the football team. The enumerated value is either CONFERENCE::AFC or CONFERENCE::NFC. This enumerated value is used to determine which conference the football team plays in. In addition to constructors, there are getter methods for each of these member variables. The no-argument constructor should set the name and city to the empty string and the conference value toCONFERENCE::NFC as well as set the record to 0-0-0 (that is, no wins, no losses, no ties). If passed arguments, the constructor should set the name, city and conference value as requested and then also set the record to 0-0-0 (that is, no wins, no losses, no ties).
The operation FootballTeam::gameScore( ... ) is used to record the results of a game played and returns void. The score provided should be used to update the various win, loss or tie counters depending on the outcome of the game. The boolean argument provided is used to determine whether the game played occurred at home or away on the road.
Each of the operations FootballTeam::homeRecord( ), FootballTeam::roadRecord( ) andFootballTeam::overallRecord( ) returns a string with the format: "w - l - t", where w is the current number of wins, l is the current number of losses and t is the current number of tie games played. In the beginning of time, each of the record strings will be returned as "0 - 0 - 0" until various calls to gameScore( ... ) take place. The overallRecord should report the results of all games played. The homeRecord should report the results of only the home games played. The roadRecord should report the results of only the road games played.
Once your FootballTeam class is working, create a function (a normal every-day average function, not a method of the FootballTeam class) with the signature shown here:

As designed, this function returns a boolean value. It should return true when the argument f has a better (overall) record than the argument g. By "better", I mean the team with more wins. If the number of wins are the same, "better" means the team then with fewer losses. If the number of wins and losses are the same, "better" means the team with more ties. If both teams have identical records, the function should return false.
You are free to create additional public and private methods and data members as you see fit. However, the test cases will only be driving the public methods of the classes diagrammed here.
The source files you turn in will be two classes and a main routine. You can have the main routine do whatever you want, because we will rename it to something harmless, never call it, and append our own main routine to your file. Our main routine will thoroughly test your functions. You'll probably want your main routine to do the same. If you wish, you may write functions in addition to those required here. We will not directly call any such additional functions.
make 2 files named FootballTeam.h and FootballTeam.cpp that implement the FootballTeam class diagrammed above and the text file named main.cppwhich will holds your main program and the betterRecord( ... ) function.
***The program you turn in must build successfully, and during execution, no method may read anything from cin. If you want to print things out for debugging purposes, write to cerr instead of cout. When we test your program, we will cause everything written to cerr to be discarded instead we will never see that output, so you may leave those debugging output statements in your program if you wish.
EXAMPLE :
#include#include #include #include "FootballTeam.h" using namespace std; int main() { // test code
FootballTeam f; FootballTeam pats( FootballTeam::Conference::AFC, "Foxboro", "New England Patriots" );
assert( f.getCity() == "" ); assert( f.getName() == "" ); assert( f.getConference() == FootballTeam::Conference::NFC ); assert( f.overallRecord() == "0 - 0 - 0" ); assert( f.roadRecord() == "0 - 0 - 0" ); assert( f.homeRecord() == "0 - 0 - 0" );
pats.gameScore( 20, 3, true ); pats.gameScore( 20, 40, true ); pats.gameScore( 20, 3, false ); pats.gameScore( 20, 40, false ); pats.gameScore( 20, 20, true ); assert( pats.overallRecord() == "2 - 2 - 1" ); assert( pats.roadRecord() == "1 - 1 - 0" ); assert( pats.homeRecord() == "1 - 1 - 1" );
assert( pats.getHomeWins() == 1 ); assert( pats.getHomeLosses() == 1 ); assert( pats.getHomeTies() == 1 ); assert( pats.getRoadWins() == 1 ); assert( pats.getRoadLosses() == 1 ); assert( pats.getRoadTies() == 0 );
assert( betterRecord( pats, f ) == true ); assert( betterRecord( f, pats ) == false ); assert( betterRecord( pats, pats ) == false ); assert( betterRecord( f, f ) == false );
cout
return 0;
} bool betterRecord( FootballTeam f, FootballTeam g ) // stubbed out just for now... {
return( false ); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
