1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

creating a football soccer tally score

Discussion in 'C++' started by weilun, Aug 6, 2007.

  1. weilun

    weilun New Member

    Joined:
    Jul 21, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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 :)
     
    Last edited by a moderator: Aug 6, 2007
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Can you explain where and why you are stuck? I would prefer words rather than debugging the code and understand your query.
     

Share This Page