subject

1. The following pseudocode tests how quickly a user can type a given sentence without making any mistakes. The statement time. clockTick() returns the number of seconds elapsed since the program started followed by the number of characters in the sentence typed.

1 sentence ← "The quick brown fox jumped over the lazy dog"

2 n ← LEN(sentence)

3 OUTPUT "Sentence to type: " + sentence

4

5 mistakeMade ← False

6

7 OUTPUT "Press Enter when you're ready to start typing! Press Enter when finished"

8 ready ← USERINPUT

9 OUTPUT "Go!"

10

11 startTime ← time. clockTick()

12 mySentence ← USERINPUT

13 finishTime ← time. clockTick()

14 totalTime ← finishTime - startTime

15

16 IF mySentence β‰  sentence THEN

17 mistakeMade ← True

18 ENDIF

19 IF mistakeMade THEN

20 OUTPUT "You made one or more errors"

21 ELSE

22 OUTPUT totalTime

23 OUTPUT n

24 ENDIF

(a) What type of variable is each of the following? [4]

(i) mistakeMade

(ii) n

(iii) totalTime

(iv) sentence

(b) What does line 16 do? [2]

(c) Alter the program so that instead of storing the sentence β€œThe quick brown fox jumped over the lazy dog”, the user can enter the sentence on which they will be timed. [3]

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
Which process would best represent the opposite of exhausting air from a system?
Answers: 2
question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
question
Computers and Technology, 22.06.2019 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
You know the right answer?
1. The following pseudocode tests how quickly a user can type a given sentence without making any mi...
Questions
question
Chemistry, 24.03.2021 05:10
question
Mathematics, 24.03.2021 05:10
question
Mathematics, 24.03.2021 05:10
question
Mathematics, 24.03.2021 05:10
question
Mathematics, 24.03.2021 05:10
question
Mathematics, 24.03.2021 05:10
Questions on the website: 13722363