创建一个程序来询问用户正确的信息,并在之后显示它们

时间:2018-10-28 00:52:13

标签: java

我不知道该怎么办,我想问一下使用者是否想显示您的详细信息或您的狗的详细信息,然后再询问他们是否输入了错误的详细信息,以及在输入了有关您或您的所有正确的详细信息之后狗,我想使用JCreator btw显示您的详细信息(如果您选择要输入的详细信息)或狗的详细信息(如果您选择要输入的详细信息)。

    Scanner me = new Scanner(System.in);
    char Let;
    System.out.print("Type A if you want to type your Details, B if you want to type your Dog's Details");
    Let = me.next().charAt(0).toUpperCase();

    if (Let.equals('a')){
        System.out.println("Enter Your Name?");
        String Name = me.nextLine().toUpperCase();
        while (Name.equals("qweqweqwe")){
            break;
        }
        System.out.println("What is your age?");
        String age = me.nextLine();
        while (age.equals("22")){
            break;
        }
        System.out.println("What is your password?");
        String pass = me.nextLine;
            while (pass.equals("Oops")){
            break;
            }
    else if (Let.equals('b')){
            System.out.println("Enter Your Dog's Name?");
            String DName = me.nextLine().toUpperCase;
            while (DName.equals("Pudge")){
            break;
            }
            System.out.println("What is your Dog's Age?");
            String DAge = me.nextLine();
            while (DAge.equals("1")){
            break;
            }
    else    {
                System.out.println("Your input is invalid, Please Try again");
            }
        }
    }
}

}

0 个答案:

没有答案