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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 01:10, brooklynneramos9956
Problem 1 - hashing we would like to use initials to locate an individual. for instance, mel should locate the person mark e. lehr. note: this is all upper case. generate a hash function for the above using the numbers on your telephone. you know, each letter has a number associated with it, so examine your telephone keypad. generate 512 random 3 letter initials and take statistics on a linked list array size 512 to hold this information report how many have no elements, 1 element, 2 elements, does this agree with the hashing statistics distribution?
Answers: 1
image
Computers and Technology, 23.06.2019 01:30, bri2728
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
image
Computers and Technology, 23.06.2019 05:00, sharkboy578
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
image
Computers and Technology, 23.06.2019 07:00, sugaree95
What are three software programs for mobile computing?
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 in other subjects:

Konu
Mathematics, 28.03.2020 05:47
Konu
Mathematics, 28.03.2020 05:47