0
How to solve 6.2 java
4 Answers
+ 4
By modifying the given code. Read the previous lesson again and pay attention to post- and pre-increment/ decrement.
If you need help with your code, please show your code.
+ 4
ONLY modify the code where it says "fix". DO NOT MODIFY THE OTHER CODE.
The initial score is whatever the user enters, not 5!
0
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//taking initial score
int initScore =5; scanner.nextInt();
int scoreTom = initScore;
int scoreBob = initScore;
System.out.println("Round 1 results:");
//fix
System.out.println(++scoreTom);
System.out.println(--scoreBob);
}
}
0
Thank you āŗļøāŗļø