Exercise: NATO alphabet trainer

Write a console program that lets the user practice the NATO phonetic alphabet. Example program output, (user input in green):
🪖 Welcome to the Nato phonetic alphabet trainer! 📡
How fast can you spell a word using the Nato phonetic alphabet?
Round 1 of 3
Spell the word "cat"
charlie alfa tango
You took 11.6 seconds to spell the word.
Correct! 🎉
Round 2 of 3
Spell the word "typing"
tango yankee papa india november golf
You took 14.3 seconds to spell the word.
Correct! 🎉
Round 3 of 3
Spell the word "Ryan"
romeo yankee alfa november
You took 8.53 seconds to spell the word.
Correct! 🎉
You spelled 3 out of 3 words correctly.
You had to spell 13 characters in total.
Average time per character: 2.65 seconds.

Hints 💡

You might use this method to convert milliseconds to a string representation of seconds:
static String msToSeconds(long milliseconds) {
  // Return the seconds as, for example, "1.52"
  String seconds = String.valueOf(milliseconds / 1000.0);
  if (seconds.length() > 4) {
    seconds = seconds.substring(0, 4);
  }
  return seconds;
}

Hand in instructions

  1. Make sure your program runs correctly.
  2. Follow Java naming conventions of variables.
  3. Make sure your program is well-formatted.
  4. Hand in your program by uploading Main.java to Moodle.