0

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

Edited by peter_budo: Keep It Clear - Do use code tags when posting any code

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by NormR1
0

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"?

0

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

0

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

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.