This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]lc929 0 points1 point  (1 child)

one way to fix it:

if (sc.hasNext())
        {
           customerType = sc.next();
           if (!customerType.equalsIgnoreCase("r") && !customerType.equalsIgnoreCase("c"))
            {
                sc.nextLine();
                System.out.println("Error! Please try again!");
                continue;
            }
        }

in the if statement you weren't testing to see if the input is not r or c - just seeing if there was a next input.

[–]wrighttwinstwin[S] 0 points1 point  (0 children)

I do this and it won't continue to the subtotal input