mercredi 28 octobre 2020

How to use if statement to go to choice [closed]

I want to use an if statement to go to different code segments

This is my code.

System.out.println("Select Action:");
System.out.println("a. Create Student File");
System.out.println("b. Write to Student File");
System.out.println("c. Caculate Student Grades");
System.out.println("d. Caculate Student Fees");
Scanner option = new Scanner(System.in);
String action1 = option.nextLine();

String action2 = "a";
String action3 = "b";
String action4 = "c";
String action5 = "d";

Thanks in advance :)

Aucun commentaire:

Enregistrer un commentaire