Typing Accuracy puzzle

Joined
Aug 25, 2022
Messages
2
Reaction score
0
Some jobs require fast typing, but they also require accuracy.
Conditions:
If accuracy is 90% or higher, then they pass.
If it is lower, then they fail.
Inputs:
  • The text to type
  • The text a person typed (this will never go past the length of the text to type)
Output:
"pass" or "fail"

Example:
Input:
"JavaScript can be used to make websites interactive."
"JavScript ca be used tt make wehsites interactive."

Output:
"pass"

Notes:
If something is not capitalized when they should be, mark it wrong.

Thanks, a newbie coder
 
Joined
Nov 13, 2020
Messages
302
Reaction score
38
You should post your code (what you have tried) here using the </> icon above the input field.

If you're totally in the dark you can compare the two strings letter by letter and keep a running count of the number of letters and how many are wrong. You should also consider the possibility that a letter is missing - or a word.
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
Use a DATE Object for starttime (on first keydown) and one for endtime (on return or whatever). Compare both to get the time. I would suggest also to calculate it with the number of letters.

Then use a string comparsion for the original string and the typed one.

That's it.




SERIOUSLY?
HELP DO NOT MEAN "WRITE MY CODE FOR ME".

Where is your code so far?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top