It seems that XL's code assumes a two-step process:
a. Get user's input - Z: End program; anything else: Load program.
b. Get user's input - Z: End program; Any other letter: Treat as employee's initial.
The bare minimum you need is just step b for this problem.
> "Hey yo, good day. Say, what do you want?"
> Input A [from range A, B, C, ..., Z].
> "Okay okay, hold on, Andrew, was it? Done. What do you want now?"
> Input B [from range A, B, C, ..., Z].
> "Hmmm.. Barbara from HR? Got it. What do you want now?"
> Input Z [from range A, B, C, ..., Z].
> "Aight, see ya later.
I'd suggest using a boolean exit flag, something like:
Code:
boolean done = false;
while(done != true) {
// do stuff because not done
if(user_input.equals("Z")) {
done = true; // set exit flag
}
}
Bookmarks