Lottery Winner Generator problem
Hi. I am having problem with my homework about this. Basicly this is lottery winner generator or random number generator using file.txt. There are 2 inputs, for the lottery number and the participant's name. The output is the name of the Winner. Here's the code I made: https://code.sololearn.com/cBHUBpaO4PD1/#java The problem is with the 3rd option. My plan with it is to generate a random number from 1-5 and turn its value to String so it can read the text file. I use while loop so it will keep scanning every line. The 'a' variabel will contain the line's value. if 'a' equals to generated random number, it will print the name under the number's line. But this one just skipped it and return to the option menu. What did I miss?