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); } }
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
+ 1
Can you post your code?
+ 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).
+ 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.
+ 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.