0

Please who can help me with java problem 7. 2

Edit So I corrected the i and the lesson is still showing failed import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int initScore = scanner.nextInt(); int ScoreBoB = initScore; int ScoreTom = initScore; System.out.println("Round 1 results"); System.out.println(++ScoreBoB); System.out.println(--ScoreTom); } }

2nd Jun 2022, 9:40 AM
Henry King
5 Answers
+ 2
If you don't pass the test cases "for over 2 weeks", it is likely that your code is not correct. Please read the task description carefully. Only modify the code after the comment that says "// fix" As already mentioned: If you need help, show your COMPLETE CODE
2nd Jun 2022, 10:39 AM
Lisa
Lisa - avatar
+ 1
Can you post your code?
2nd Jun 2022, 10:28 AM
Justice
Justice - avatar
+ 1
Don't you need a capital "i" for "Scanner.nextInt();"? You also need to pay attention to which score should be increased and which should be decreased (I think you missed that).
2nd Jun 2022, 4:17 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Ausgrindtube Ah, they posted an edit of their code without saying anything so I didn't see. But you're right, Java is case-sensitive.
2nd Jun 2022, 4:18 PM
Justice
Justice - avatar
+ 1
Henry King is the same value supposed to initialize both scores? If not, then you need to call initScore = scanner.nextInt(); after initializing BoBs score. Also, your code above is missing the last two }. Not sure if that was a copy issue or part of your problem.
14th Jun 2022, 5:17 AM
The Darkness
The Darkness - avatar