ユーザーの入力に応じて、特定の文をどのように印刷するのか疑問に思っています。
以下のシナリオでは、ユーザーが「B」と入力した場合、「あなたはBを選択しました」という単語を印刷しますが、ユーザーがCIを選択した場合、「あなたはCを選択しました」という単語を印刷します。
import java.util.Scanner;
public class Trial extends Register
{
//I want to load the register which will be option B
public static void main (String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Enter A to make a purchase & receive your change");
System.out.println("Enter B to load the Register");
System.out.println("Enter C to write the contents of the Register to a
web Page");
System.out.println("Enter D to exit the program");
}