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

  1. Write a program for keeping track of the line score of a baseball game. Specifically, your program should do the following.

    1. Prompt the user to input the names of the home and away teams as strings.

    2. 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

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!