0
Tom and Bob are playing a board game, in which both players start with the same number of points. Tom won the first game and got
10 Answers
+ 10
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//taking initial score
int initScore = scanner.nextInt();
int scoreTom = initScore;
int scoreBob = initScore;
System.out.println("Round 1 results:");
//fix
System.out.println(++scoreTom);
System.out.println(--scoreBob);
}
}
+ 1
What is your questions ¿¿
+ 1
Hes trying to fix this code
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//taking initial score
int initScore = scanner.nextInt();
int scoreTom = initScore;
int scoreBob = initScore;
System.out.println("Round 1 results:");
//fix
System.out.println(scoreTom++);
System.out.println(scoreBob--);
}
}
+ 1
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//taking initial score
int initScore = scanner.nextInt();
int scoreTom = initScore;
int scoreBob = initScore;
System.out.println("Round 1 results:");
//fix
System.out.println(++scoreTom);
System.out.println(--scoreBob);
}
}
Good Luck
0
Please link your attempt first.
0
PLs HELP
0
Loved it. In addition, I'm an ardent gamer who's always on the lookout for the latest and greatest in gaming hardware. My fingers are crossed that I'll be the lucky winner of an ASUS laptop when the https://drakemall.com/boxes/pc-master-race-box opens online. But Dell Alienware is what I've always wanted. All of the major awards are expected to be mine shortly.
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 = scanner.nextInt();
int scoreTom = initScore;
int scoreBob = initScore;
System.out.println("Round 1 results:");
//fix
System.out.println(++scoreTom);
System.out.println(--scoreBob);
}
}
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 = scanner.nextInt();
int scoreTom = initScore;
int scoreBob = initScore;
System.out.println("Round 1 results:");
//fix
System.out.println(++scoreTom);
System.out.println(--scoreBob);
}
}
thanks You
budhabhushan waghmare
tech brain booster
- 1
Tom and Bob are playing a board game, in which both players start with the same number of points. Tom won the first game and got 1 point, while Bob lost the game, and therefore lost 1 point.
You are given a program that is intended to take the initial score and increase Tom's score by 1 and decrease Bob's score by 1.
But something is wrong: the program outputs the scores without the change.
Task
Fix the program to result in the expected outputs.
Sample Input
5
Sample Output
Round 1 results:
6
4