1. Prompt the user and read in the number of a team playing the current game, i.e. Team 1, Team 2, Team 3, etc. 2. Prompt the user and read in the number of the opponent team. It is probably helpful to think of the first team as the home team for this game, and the second team as the away team. 3. Prompt the user and read in a team’s score for the current game. Use the team’s number when asking for the score in your printf statement. 4. Prompt the user and read in the opponent’s score for that game. Again, use the opponent’s team number when asking for the score. 5. Notify the user and repeat steps 3 and 4 in the case that the user enters a negative value. 6. Calculate the points earned by each team and add it to a cumulative score. A win is worth 3 points, a draw is worth 1 point and a loss is zero points. Also update the amount of games played by each team and their goals for and against. 7. Print to the screen the following header and beneath it a line of data that corresponds to the header for each team. Make sure the columns are correctly aligned. Team Played Goals for Goals against Points There is no requirement for your program to sort the teams by order of points. The teams can simply be listed from Team 1 to Team 6. 8. Terminate the program by asking the user if they wish to do so. Otherwise repeat all of the above from step 1. - C Language

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 14E: In Chapter 4, you created a program that generates a random number, allows a user to guess it, and...
icon
Related questions
Question

1. Prompt the user and read in the number of a team playing the current game, i.e. Team 1, Team 2, Team 3, etc.

2. Prompt the user and read in the number of the opponent team. It is probably helpful to think of the first team as the home team for this game, and the second team as the away team.

3. Prompt the user and read in a team’s score for the current game. Use the team’s number when asking for the score in your printf statement.

4. Prompt the user and read in the opponent’s score for that game. Again, use the opponent’s team number when asking for the score.

5. Notify the user and repeat steps 3 and 4 in the case that the user enters a negative value.

6. Calculate the points earned by each team and add it to a cumulative score. A win is worth 3 points, a draw is worth 1 point and a loss is zero points. Also update the amount of games played by each team and their goals for and against.

7. Print to the screen the following header and beneath it a line of data that corresponds to the header for each team. Make sure the columns are correctly aligned. Team Played Goals for Goals against Points There is no requirement for your program to sort the teams by order of points. The teams can simply be listed from Team 1 to Team 6.

8. Terminate the program by asking the user if they wish to do so. Otherwise repeat all of the above from step 1.

- C Language

X
D:\teaching\eng115\labsvs\lab5\Debug\lab5.exe
Home team number: 1
Away team number: 2
Home team (Team number 1) scored goals: 3
Away team (Team number_2) scored goals: 2
Tean
Team
Team1
Played
1
Goals For
Points
Goals Against
3
2
3
Team2
1
2
+
3
0
Team3
0
ម
0
0
Team4
0
ម
0
0
Team5
ម
ទ
0
0
Team6
0
0
0
0
១
Do you want to close the program? [Y/N] =,
111
Figure 4.1 Illustrative Output of the Assessed Program.
X
C. C:\windows\system32\cmd.exe
Home team number: 1
Away team number: 2
Home team (Team number 1) scored goals: 3
Away team (Team number_2) scored goals: 2
Team
Goals For
Played
Goals Against
Points
Team1
1
3
2
3
Team2
1
2
3
0
Team3
ម
0
0
Team4
Team4
0
G
២
0
ម
ด
0
Team5 0
Team6
G
0
ម
}
Do you want to close the program? [Y/N] =n
Home team number: 1
Away team number: 5
Home team (Team number 1) scored goals: -2
Away team Team number 5) scored goals: 0
Home team (Team number 1) scored goals: 2
Away
team (Team number 5) scored goals: 0
Team Played Goals For
Goals Against
Points
6
Team1
2
5
2
Team2
1
2
3
Team3
ម
Team4
8
0
0
0
✔
Team5
1
2
0
Team6
a
0
0
Do you want to close the program? [Y/N] =n
Home team number: 2
Away team number: 3
Home team <Team number 2) scored goals: 2
Away team (Team number 3) scored goals: 2
Played Goals For
Goals Against
Points
Team
Cam
Team1
2
5
2
6
Team2
2
4
5
1
Team3
1
2
1
Team4
0
0
Team5
1
0
2
0
Team6
0
ឲ
0
ម
Do you want to close the program? [Y/N] =y
Press any key to continue
111
Figure 4.2 Further Illustrative Output of the Assessed Program.
E
Transcribed Image Text:X D:\teaching\eng115\labsvs\lab5\Debug\lab5.exe Home team number: 1 Away team number: 2 Home team (Team number 1) scored goals: 3 Away team (Team number_2) scored goals: 2 Tean Team Team1 Played 1 Goals For Points Goals Against 3 2 3 Team2 1 2 + 3 0 Team3 0 ម 0 0 Team4 0 ម 0 0 Team5 ម ទ 0 0 Team6 0 0 0 0 ១ Do you want to close the program? [Y/N] =, 111 Figure 4.1 Illustrative Output of the Assessed Program. X C. C:\windows\system32\cmd.exe Home team number: 1 Away team number: 2 Home team (Team number 1) scored goals: 3 Away team (Team number_2) scored goals: 2 Team Goals For Played Goals Against Points Team1 1 3 2 3 Team2 1 2 3 0 Team3 ម 0 0 Team4 Team4 0 G ២ 0 ម ด 0 Team5 0 Team6 G 0 ម } Do you want to close the program? [Y/N] =n Home team number: 1 Away team number: 5 Home team (Team number 1) scored goals: -2 Away team Team number 5) scored goals: 0 Home team (Team number 1) scored goals: 2 Away team (Team number 5) scored goals: 0 Team Played Goals For Goals Against Points 6 Team1 2 5 2 Team2 1 2 3 Team3 ម Team4 8 0 0 0 ✔ Team5 1 2 0 Team6 a 0 0 Do you want to close the program? [Y/N] =n Home team number: 2 Away team number: 3 Home team <Team number 2) scored goals: 2 Away team (Team number 3) scored goals: 2 Played Goals For Goals Against Points Team Cam Team1 2 5 2 6 Team2 2 4 5 1 Team3 1 2 1 Team4 0 0 Team5 1 0 2 0 Team6 0 ឲ 0 ម Do you want to close the program? [Y/N] =y Press any key to continue 111 Figure 4.2 Further Illustrative Output of the Assessed Program. E
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning