Help Please | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Help Please

Programming involves typing. You are curious how much effort it takes to type a C program. This project assumes you are a rich typist. It captures the keystrokes that each of your fingers (index, middle, ring, pink) makes when typing a block of text and prints some basic statistics regarding your typing. The program needs to identify the number of keystrokes that each finger performed when typing block of text. Also it needs to identify how many strings were typed using only the left hand and then right.

23rd Feb 2018, 5:22 AM
Taylor Conant
3 Answers
+ 1
first this would not be accurate because it would require sensors to know what fingers are being used. you could map out proper finger location and have it count strokes and store each to its fingers array/list but it cant tell if you are cheating without sensing finger position on the keyboard.
23rd Feb 2018, 5:33 AM
emmey
emmey - avatar
0
If I understand the question correctly, you can modify a counter for each letter typed, e.g. when the next letter you're getting from the input is a "q" "a", "z", "p" or "l" you add one to the counter for the pinky (create similar lists for each finger). To keep track of the words that are fully on the left hand or on the right hand, you can keep track of which hand each key is in and, after a space and a new letter is processed you can set a Boolean for the corresponding hand to true continue until the next space and then check that only one of the booleans are true (by using XOR, for instance). If XOR returns true, you used only one hand, check which is true and that tells you which hand, otherwise you used both hands
23rd Feb 2018, 5:44 AM
Kevin Hernandez
Kevin Hernandez - avatar
0
It's hard to read the problem as stated. I think that the OPs statement "This project assumes you are a rich typist" means that it is assumed that you use the keyboard as a seasoned typist would without a fault and no sensor or double check is required; I may be misunderstanding but that's what I based my suggestion on
23rd Feb 2018, 6:01 AM
Kevin Hernandez
Kevin Hernandez - avatar