Answer to Question #235810 in Java | JSP | JSF for Princess

Question #235810
Special consideration needs to be made for the selection of the product category. Allow

the user to make a selection between the following categories:

• Desktop Computer.

. Laptop.

.

Tablet.

Printer.

• Gaming Console.
1
Expert's answer
2021-09-10T23:52:28-0400
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    Scanner in =new Scanner(System.in);
	    System.out.println("Choose a category: \n1. Desktop Computer \n2. Laptop \n3. Tablet \n4. Printer");
	    int c;
	    c=in.nextInt();
	    if (c==1){
	        System.out.println("You have chosen Desktop Computer for game console"); 
	    }
	    else if (c==2){
	        System.out.println("You have chosen Laptop for game console");
	    }
	    else if (c==3){
	        System.out.println("You have chosen Tablet for game console");
	    }
	    else if (c==4){
	        System.out.println("You have chosen Printer for game console");
	    }
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS