Worksheet-1
Unit-1 Computational thinking and programming
Pseudocode algorithm
Read this pseudocode algorithm and then answer the questions.
OUTPUT "Please enter your favourite number"
INPUT number
OUTPUT "Enter a number to add to this number"
INPUT addNumber
final = number + addNumber
OUTPUT "Enter a number to multiply by"
INPUT multiplyNumber
final = final * multiplyNumber
OUTPUT "The result is", final
1 How many variables are used in this algorithm?
2 Which assignment symbol is used in this algorithm?
3 What does the comma (,) on the last line of the algorithm do?
4 Which line of code accesses data in a variable, changes the value, then stores the result back in
the same variable?
5 Why are the words Please enter your favourite number on the first line in double
quotation marks?
Why is the word final in the last line not in double quotation marks?
6 What are the names of the two arithmetic operators used in the algorithm?
7 The following data will be input into the algorithm, in the order given:
5
3
10
a Test the algorithm with the data given. Write down all the output messages that
the program will display.
b What will be the final output if the mathematical operator * is replaced by the operator / ?