0

Logical statements lab isn’t passing

My code is below, this is for the 13.1 practice labs import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); int population = 9955; read.nextInt(); int area = 7522; read.nextInt(); //Complete the code if (population < 10000 && area < 10000) System.out.println("small country"); } }

8th Jan 2023, 6:50 AM
George Hamilton
George Hamilton - avatar
2 Respuestas
+ 2
<population> and <area> should be read as input from Scanner <read> int population = read.nexrInt(); int area = read.nextInt(); You are not reading any input when you should.
8th Jan 2023, 7:12 AM
Ipang
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); int population = 9955; int area = 7522; // Read input from the user population = read.nextInt(); area = read.nextInt(); // Complete the code if (population < 10000 && area < 10000) { System.out.println("small country"); } else { System.out.println("large country"); } } }
8th Jan 2023, 7:14 AM
Aditya Dixit