I need some help with doing a choice. Atm i have

choice =

                switch (choice)
            {
                case 'A':
                case 'a':
                    {
                        optel ();
                        break;
                    }
                case 'B':
                case 'b':
                    {

                        break;
                    }
                case 'C':
                case 'c':
                    {
                        break;
                    }

                default:
                    {
                        System.out.println ("You did not choose any of the options");
                        break;
                    }
            }
        }
        while (Character.toUpperCase (choice) != 'X')
            ;
        System.out.println ("Bye-Bye");

But i dont know what to do after i just want to make a normal choice

Recommended Answers

All 3 Replies

I don't understand your question.
Look at the cases for 'A' and 'a' - they call a method optel() when the user chooses 'A' or 'a'. Isn't that "a normal choice"?

After a normal choice loop will bring you back to again selecting new choice state, so press 'X' to exit.

One thing your posted code does not do is ask the user to enter his choice.
Once in the while loop, if the value of choice is not changed, you will never exit the loop.

In future, please wrap your code in code tags

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.