if (option == "F" || option == "f")
Here's your problem. == tests for two objects being exactly the same object, but option is something you just read from the scanner, and "F" is a String created at compile time - they are two different objects, so the == test is always false.
To compare Strings you can use the equals method which tests that the strings have the same sequence of letters in them. Even better, for this case, is equalsIgnoreCase method, which does what it says. So...
if (option.equalsIgnoreCase("f")) ...
JamesCherrill
... trying to help
8,683 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,479
Skill Endorsements: 33
No, = is assignment, so option = "C" assigns the value "C" to option, then the || makes no sense so it errors.
== returns false because they are two different objects, it's as simple as that. The only version that works is
if (option.equals("C") || option.equals("c"))
or, of course, the ignoresCase version that does the same thing.
JamesCherrill
... trying to help
8,683 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,479
Skill Endorsements: 33
You do that with a while loop or a do/while loop - lots of examples and tutorial stuff on the web, like this one
JamesCherrill
... trying to help
8,683 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,479
Skill Endorsements: 33
You have all the right stuff - it's just not in the right place!
You have two while loops, but one is all you need.
The loop in lines 47-57 is basically right, but that needs to encompass the whole thing, not just be there on its own at the end of the program.
The while at line 15 is in the right place, but it should have the "play" boolean logic.
So take the code for the 47-57 loop and use that to replace the while (true) on line 15.
You're 95% there, and it will probably look a lot simpler after a good night's sleep.
JamesCherrill
... trying to help
8,683 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,479
Skill Endorsements: 33