Computational constructs test questions

1

What does the following line of code do?

SET result TO a*5

2

Which of the following lines of code would be used to concatenate the word 'hello' with the username of user, where ‘username’ is a variable?

3

What is the difference between a simple condition and a complex condition?

4

What is wrong with this piece of code?

Line 1: SET fahrenheitTemp TO (celsiusTemp * (9/5)) + 32

Line 2: RECEIVE celsiusTemp FROM (INTEGER) KEYBOARD

Line 3: SEND fahrenheitTemp TO DISPLAY

5

What does the code shown below do?

Line 1: RECEIVE mark FROM (INTEGER) KEYBOARD

Line 2: IF mark ≥ 80 THEN

Line 3: SEND “You received a merit award” TO DISPLAY

Line 4: ELSE

Line 5: SEND “You did not gain a merit award this time” TO DISPLAY

Line 6: END IF

6

If we have a piece of code that uses iteration what does this mean?

7

What is a fixed loop?

8

Which of these constructs is an example of a selection statement rather than a loop?

9

The piece of code shown below is an example of which of the following?

SET raffleTicket TO RANDOM (1,50)

10

Which of these is not a logical operator?