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

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(" ");

Step by Step Solution

3.47 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Code import random import time x randomrandint04 strings My ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!