something like this?
Code:import java.io.Console; public class Something { public static void main(String[] args) { Console console = System.console(); String name = console.readLine("Enter name: "); while(true){ System.out.println("Category:\n[A]Politics\n[B]Foods\n[C]Religion\n\n"); String sLetter = console.readLine("Select Letter: "); char[] cLetter = sLetter.toCharArray(); switch(cLetter[0]){ case 'a': //put here the "output" System.out.println("a chosen"); break; case 'b': //put here the "output" System.out.println("b chosen"); break; //put here the "output" case 'c': System.out.println("c chosen"); } String exit = console.readLine("Do you want to continue?\n"); if(exit.equals("No")){ System.exit(0); } } } }




Reply With Quote