It shouldn't. What you'll need is a way for the user to tell the program that he wants to exit the program. Usually that is done by having the user enter a special value to signal he's done. When the...
Type: Posts; User: Norm
It shouldn't. What you'll need is a way for the user to tell the program that he wants to exit the program. Usually that is done by having the user enter a special value to signal he's done. When the...
Describe what you want to use a loop for.
Two popular loops:
for() which can use a variable that is initialized to a value and incremented and tests an ending condition
while(condition) which...
This won't work.
opt is a String variable and 1 is an int literal.
If you want to compare a String to another String, use the equals method.
If the literal 1 is to be a String enclose it in "1"