Question
Coding in C Programing Write a program for keeping track of the line score of a baseball game. Specifically, your program should do the following.
Coding in C Programing
-
Write a program for keeping track of the line score of a baseball game. Specifically, your program should do the following.
-
Prompt the user to input the names of the home and away teams as strings.
-
The program should ask the user which inning to edit, and then ask for the scores for that inning. The program should then repeat asking for the inning to edit and the scores for the inning, until the user enters 0 for the inning to edit, which will stop the input loop. After editing an inning, the program should print the current state of the line score in the table format shown above. The scores should be stored in one or more arrays.
-
Team | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | R |
away | ||||||||||
home |
C. After acquiring scores for each team for each inning, the program should sum up the total score for each team and announce the winner of the game (i.e., which team has the greater score).
-
home and away are the names of the two teams
-
boxes 1 through 9 contain the number of runs scored by the team for that inning
-
R is the total runs scored by that team for the game
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