+ 9
You spell "confirmed" with a capital C, is that correct?
7th Mar 2023, 8:26 PM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 3
You're welcome :)
8th Mar 2023, 4:50 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 1
import java.util.Scanner; public class Program { //your code goes here /* User message: "1", Reply: "Order confirmed" User message: "2", Reply: "info@sololearn.com" For any other number, the reply should be: "Try again". */ public static void bot() { Scanner scanner = new Scanner (System.in); int userInput = scanner.nextInt(); if (userInput==1){ System.out.println("Order confirmed"); }else if(userInput==2){ System.out.println("info@sololearn.com"); }else{ System.out.println("Try again"); } scanner.close(); } public static void main(String[] args) { bot(); } }
28th Oct 2023, 9:21 AM
dennis rasugu
dennis rasugu - avatar
+ 1
THIS IS CORRECT. import java.util.Scanner; public class Program { public static void main(String[] args) { bot(); } public static void bot(){ Scanner sc = new Scanner(System.in); int num = sc.nextInt(); switch(num){ case 1: System.out.println("Order confirmed"); break; case 2: System.out.println("info@sololearn.com"); break; default: System.out.println("Try again"); } } }
6th Oct 2024, 2:38 PM
BAMIGBAYE IBUKUNOLUWAPO
BAMIGBAYE IBUKUNOLUWAPO - avatar