0
    System.out.print("What is the first number? ");
    x=user.nextInt();
    System.out.println();
    System.out.print("What is the second number? ");
    y=user.nextInt();
   System.out.println();

    System.out.print("Answer yes/no. Would you like to multiply? ");
    ans=user.nextLine();
    System.out.println();
    if(ans.equals("yes")||ans.equals("y"))
    {
        System.out.println(x*y);
    }
    else {
        System.out.println("How about division? ");
        ans=user.nextLine();
        System.out.println();

===============

this is the output

What is the first number? 6

What is the second number? 5

Answer yes/no. Would you like to multiply? How about division?

======== Why does it not wait to take user input after the mulitplication question?

0 Answers0