+ 2

I'm lost on the answer

I can't get an output and I am very confused, everything looks fine to me but it does not work. 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 if(isSuspended) { System.out.println("Suspended."); else { if(ourScore < theirScore) { System.out.println ("Lost"); } if(ourScore > theirScore) { System.out.println ("Won"); } if(ourScore == theirScore) { System.out.println("Draw"); } } }

5th Mar 2021, 9:01 PM
Shy Rose
Shy Rose - avatar
7 Respostas
+ 6
You're missing some '}' at the end of the statements. if (condition){ } else { if(){ } .... if(){ } }
6th Mar 2021, 2:02 AM
Simba
Simba - avatar
+ 2
Shy Rose Go to your code bits option then create that code and save it.. Then click share and copy the link then paste here.
5th Mar 2021, 9:20 PM
Samira
Samira - avatar
5th Mar 2021, 9:23 PM
Shy Rose
Shy Rose - avatar
0
please use code playground to share all code.
5th Mar 2021, 9:13 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
I will go find that thank you
5th Mar 2021, 9:13 PM
Shy Rose
Shy Rose - avatar
0
Wilbur Jaywright Where is that? Will I get help there?
5th Mar 2021, 9:16 PM
Shy Rose
Shy Rose - avatar
0
It turns out I forgot to use */ at the bottom of my multi-line comment. Simple.
5th Mar 2021, 11:20 PM
Shy Rose
Shy Rose - avatar