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, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until β€˜esc' and show without narration options. b. click set up slide show, and then select the loop continuously until β€˜esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
Whose task it is to ensure that the product flows logically from one step to another?
Answers: 3
question
Computers and Technology, 24.06.2019 00:00
Afashion designer wants to increase awareness about her brand. which network can she use and why she can use the blank to blank her products online. answers for the first blank: internet, extranet, or intranet answers for the second blank: market, design, and export
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
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
Mathematics, 07.07.2019 12:30
Questions on the website: 13722367