Java problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Java problem

Hello everybody! Please help me with the problem with the administrator. I tried several times but i don't succeed! Many thanks!!!

21st Apr 2021, 5:28 PM
Remus Tanasa
6 Answers
+ 1
Remus Tanasa And what is your problem with this task? if isSuspended is true you just print "Suspended". If it is false you compare yourScore with theirScore. yourScore > theirScore print "Won" yourScore == theirScore print "Draw" yourScore < theirScore print "Lost"
21st Apr 2021, 6:23 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Many thanks, Denise!!!
21st Apr 2021, 6:58 PM
Remus Tanasa
+ 1
Remus Tanasa Your welcome :)
21st Apr 2021, 7:14 PM
Denise Roßberg
Denise Roßberg - avatar
0
Hello Remus Tanasa Please show us your code so that we can help you.
21st Apr 2021, 5:41 PM
Denise Roßberg
Denise Roßberg - avatar
0
Am right, that you mean this exercise? You are an administrator at a football club who must categorize already played games on the team's website. The given program takes 3 inputs: 1. match status - which checks if the match is suspended ("true") or not suspended ("false") 2. your team's score 3. opposing team's score. Complete the program so that if the match is suspended (the 1st input is "true"), it will output "Suspended". If the match is not suspended ( the1st output is false), the following statuses should be set depending on the match result: "Won", "Lost" and "Draw". Sample Input false 3 2 Sample Output Won
21st Apr 2021, 5:44 PM
Denise Roßberg
Denise Roßberg - avatar
0
Yes, this is the problem. And the problem starts with import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); boolean isSuspended = read.nextBoolean(); int ourScore = read.nextInt(); int theirScore = read.nextInt(); // your code goes here
21st Apr 2021, 6:15 PM
Remus Tanasa