Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   creating a football soccer tally score (http://www.go4expert.com/forums/creating-football-soccer-tally-score-t5696/)

weilun 6Aug2007 09:01

creating a football soccer tally score
 
the output must be

Main Menu of the Football Score Tally Program
[1] Read in the Team and Match Details
[2] Display Individual Team Score
[3] Display Entire Group Score
[4] Quit the program
Choice? 2

Displaying the 4 teams and the respective 3-letter coding:
France: FRA Switzerland: SUI
South Korea: KOR Togo: TOG

Please enter the 3-letter team code: FRA

Number of the matches played by the France team is 3
Match [1]: France drew with Switzerland 0:0
Match [2]: France drew with South Korea 1:1
Match [3]: France won Togo 2:0

The score tally of France team is
P W D L F A Pts
France 3 1 2 0 3 1 5




actually i have done halfway but was stuck ...


Code:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int CHOICE;
void TakeAction(int );
int CalcScore();
void ReadData (String  );
void AllGroupsScore();

class team
{
private:
        char SouthKorea,France,Switzerland,Togo;

public:
        team(char KOR, char FRA, char SUI, char TOG)
        {
                KOR=SouthKorea;
                FRA=France;
                SUI=Switzerland;
                TOG=Togo;
        }
};

void main()
{
cout<<"[1] Read in the Team and Match Details" <<              (      );
cout<<"[2] Display Individual Team Score"    <<              (      );
cout<<"[3] Display Entire Group Score"        <<              (      );
cout<<"[4] Quit the program"                  <<              (      );       

cout<<"Pleas Enter Your Choice?:  ";                             
cin >> CHOICE;
TakeAction(CHOICE
cout<<endl;
}

int CalcScore()
{


}
int TakeAction(int CH)

{
        switch (CHOICE)
        {
//case 1 Call function to read Data from File............XXX *= _  _ _;
        case 1:
        { ifstream team;
                string  buffer;

                team >> buffer;
                team.open("E:data.txt");
                team.close();

                cout << buffer << endl;
        }
                        break;
       

//  case 2 Call a funtion to CalcScore ans display the score.............XXX *= _  _ _;
        case 2: cout<<"Displaying the 4 teams and the respective 3-letter coding:"<<endl;
            cout<<"France: FRA                          Switzerland: SUI"<<endl;
            cout<<"South Korea: KOR                Togo: TOG"<<endl;
                        cout<<"Please enter the 3-letter team code:"<<endl;
                        cin>>code;
                        break;


//        case. 3 Claculate all the groups Score............XXX *= _  _ _;
                        break;
                //  case..Terminate the Program ......XXX *= _  _ _;
                        break;
        }
        return(  XXX      )
}
void ReadData(String  FileName)
{


}
void AllGroupsScore()
{


}

please guide me along...thanks :)

shabbir 6Aug2007 09:29

Re: creating a football soccer tally score
 
Can you explain where and why you are stuck? I would prefer words rather than debugging the code and understand your query.


All times are GMT +5.5. The time now is 22:56.