Write a complete C program, including comments, to compute baseball statistics. The program computes various things about a team and prints everything out. The it repeats the process for each new team until the entire set of data has been completed. a. The program reads in the ID number of a team. It read in the number of wins and the number of losses. (i.e. Team ID 1234, Win 2, Losses 3). b. The program compute (and print) the total number of games played, which is simply the number of wins plus the number of losses. If the total is exactly 20, the program prints a message saying the season is finished. If the total is less, the program prints how many games are left. No team has played more than 20 games. For example, for the team above, the total number of games played 12, there are 8 games left (20-12). c. The program computes the team’s winning percentage, which is a decimal value between 0 and 1. The winning percentage is the number of games won divided by games played. For the team above, the winning percentage is 5/12=0.41667. the program prints this out as shown, with exactly five decimal places. d. The program compute how much the team is above or below 0.50000. This is defined as follows. If the team has won more games than it has lost (or if these are equal), the amount above 0.50000 is the number of wins minus the number of losses. Otherwise, the amount below 0.50000 is the number of losses minus number of wins. This value should be printed with an appropriate message (saying if this is games above or below 0.50000). For example, the team is 2 games below 0.50000 (5 is less than 7, and 7-5=2). e. Repeats the entire process for the next team until it reaches the last one. At the point, print the total number of teams in the league and stop.
Answers
Answered by
1
Explanation:
Can you pin the attachment here... It's very messy to read
Similar questions