You're welcome
No, you don't need to add a call to myScanner. It is all in there. An awkward bit of syntax, which you would never work out for yourself if nobody showed you it. Inside the () after while, you have a call to input.nextLine(). There is no need for a second newLine call, which would simply discard the name entered first. Remember the loop has to go back to the () after while every run, and there is a call in those () so it will always be executed. Try it, in the form I posted, and you can see whether it works.
This trick will let you see about the break: Add the
if () . . . break block again, but make it a proper block with {}. Just before the break; command, insert a line like this:
System.out.println("Stop entered: goodbye.");. Then you can see whether you ever reach that block at all. Well done your teacher saying "break" is poor practice.
You are right that
float arithmetic is about 4 times as fast as
double arithmetic. Try it. Put in calls to the nanoTime method. Look for its full details in the
System class.
You can see it takes maybe 1μs to do nothing and longer if you do something real. You will also notice the times vary for no apparent reason. Get a stopwatch and see how long it takes from printing out "Enter name, or stop to finish" to entering "Campbell Ritchie".
The real problem with primitive fractional arithmetic is precision. Some books do tell you to use it, but it is not suitable for anything requiring precision, eg money. For money
you should use integer arithmetic, or BigDecimal, but that is probably beyond the requirements of a beginner's exercise.