Question: Write a C program (NOT C++) that stores data from a football teams recent results file results.txt into a struct array and prints out a

Write a C program (NOT C++) that stores data from a football teams recent results file results.txt into a struct array and prints out a each teams first result in such format: [TEAM SCORE OPPONENT] and also calculate the amount of goals scored and conceded for each team.

results.txt format: TEAM OPPONENT***SCORE (Home Score:Away Score)

example: Manchester United Chelsea***2:1 Arsenal***3:0

Chelsea Liverpool***0:1 Sheffield United***4:0 Leicester City Brighton Hove and Albion***3:5 West Ham United***3:2

Output:

Manchester United 2:1 Chelsea Chelsea 0:1 Liverpool Leicester City 3:5 Brighton Hove and Albion

Manchester United Scored 5 goals and conceded 1. Chelsea Scored 4 goals and conceded 1. Leicester City Scored 6 goals and concede 7.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!