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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started