+ 1
chaosacid The OP code not taking input into account. The corrected code is already posted by others.. Here it is again... .. share your in separate thread if any trouble with code always ... import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int price = scanner.nextInt(); //complete the code //int car_price = 11000; remove this if( price <=12000 ) { System.out.println("yes"); } } }
1st Feb 2023, 1:05 PM
Jayakrishna 🇼🇳
0
I'm typing all of this in but it still shows an error message.
5th Oct 2022, 6:42 PM
Austin Loper
Austin Loper - avatar
0
its still wrong, why is it saying yes even if it inputs higher value like 15000.
1st Feb 2023, 12:47 PM
chaosacid
chaosacid - avatar
- 1
Add the description in description place.. Question is cut off. Where you are using input 'price'?
10th May 2022, 4:13 PM
Jayakrishna 🇼🇳
- 1
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int price = scanner.nextInt(); //complete the code if(price <=12000) { System.out.println("yes"); } } }
12th Jun 2022, 7:28 PM
Lourdes Escobar
Lourdes Escobar - avatar
- 2
You have $12,000 to buy a car. You're given a program which takes the price of car as an input.
16th May 2022, 2:29 AM
Bakary Amara SOUMARE
- 2
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int price = scanner.nextInt(); //complete the code if(price <=12000){ System.out.println("yes"); } } }
29th Sep 2022, 8:39 PM
Lindsey Udeh