You are asked to write a Typing game. Your game teaches typingby generating a random sentence for
Question:
You are asked to write a Typing game. Your game teaches typingby generating a random sentence for the user. The user should typethe sentence as fast as she/he could. Your code should then printthe following results:
• the time it took the user to type the sentence • number oferrors (mismatched words)
• number of non typed words (if the user typed less wordsthan required)
• number of words typed per sec.
Your code should include 5 sentences consisting of 8-14 wordeach. Each time a user plays the game a random sentence will beselected from an array of strings.
HINT :
Store user message (input) into an array of strings:
Use a String to read the sentence from the user, then use themethod “split” to
split the sentence into different words (strings) and store eachword into a cell of
an array-of-strings. Here is an example of using “split”:
String sentence = "Hello! I am a Spy!";
String [] words;
words = sentence.split(" ");