IN JAVA CODE: Hosting a game is so exciting! When a game is finished, would it not be great if we can automatically broa

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

IN JAVA CODE: Hosting a game is so exciting! When a game is finished, would it not be great if we can automatically broa

Post by answerhappygod »

IN JAVA CODE:
Hosting a game is so exciting! When a game is finished, would it
not be great if we can automatically broadcast the results?
Given 2 team names and another 2 scores of the teams
respectively, output the name of the team who got the higher score
(that is “[Team_Name] wins [winner_score]-[looser_score]” --
example: “A wins 98-90”).
If the score is the same, print “Game tied”.
Input
The first line is the team name (a character) of the first team,
The second line is the team name (a character) of the second team,
The third line is the score of the first team, and The fourth line
is the score of the second team.
L
C
98
90
Output
If one score is greater than the other, “[Team_Name] wins
[winner_score]-[loser_score]” If both scores are the same, "Game
tied"
L wins 98-90
Test Case 2:
Input
Output
Test Case 3:
Input
Output
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply