import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int ch = -1;
while (ch != 6) {
System.out.println("1. Desktop Computer.");
System.out.println("2. Laptop.");
System.out.println("3. Tablet.");
System.out.println("4. Printer.");
System.out.println("5. Gaming Console.");
System.out.println("6. Exit.");
System.out.print("Select the product category: ");
ch = in.nextInt();
in.nextLine();
if (ch == 1) {
System.out.println("You have selected Desktop Computer.");
} else if (ch == 2) {
System.out.println("You have selected Laptop.");
} else if (ch == 3) {
System.out.println("You have selected Tablet.");
} else if (ch == 4) {
System.out.println("You have selected Printer.");
} else if (ch == 5) {
System.out.println("You have selected Gaming Console.");
} else if (ch == 6) {
} else {
System.out.println("Wrong selection.");
}
}
in.close();
}
}
Comments
Leave a comment