Professional Documents
Culture Documents
Pseudocode
Pseudocode
It asks to the user to enter First number, value will be stored in the variable firstNumber
It asks to the user to enter Second number, value will be stored in the variable secondNumber
Then adds them together and result is stored in the variable total.
Total of two numbers will be display.
The code asks for the number of teeth to be inputted, in the variable numberOfTeeth
If the number of teeth is between 0 and 32, then "Seems normal" is displayed
If the number entered is higher than 32, then "Too many teeth" is displayed
The sensor keeps on receiving the temperature in temp variable while it is 100 degree Celsius.
When the value in temp variable reaches 100 degree Celsius, the sensor will switch off the kettle.
Page 1 of 5
5. What does this code do?
Page 2 of 5
d) SET MyString TO ‘Hello world’
9. To show in pseudocode that you have finished using selection, you must always use?
a) END FOR
b) END IF
c) END PROCEDURE
d) END REPEAT
10. To show in pseudocode that you have finished using a count controlled loop, you must always use?
a) END IF
b) END FOR
c) END PROCEDURE
d) END REPEAT
a) Selection
b) Iteration
c) Sequence
d) Nothing
2. print(“hello”)
ANS) SEND “hello” TO DISPLAY
Page 3 of 5
4. if age>=18:
ANS) IF age>=18 THEN
5. if password_attempt1==password_attempt2:
ANS) IF password_attempt1= password_attempt2 THEN
7. IF age>=18 THEN
ANS) if age>=18:
ARITHMETIC OPERATORS
3. Modulus will?
ANS) Return the remainder of a division
4. 13 MOD 4= 1
5. 20 MOD 6 = 2
6. 17 MOD 3 = 2
Page 4 of 5
If number = 7, then remained will be set to?
ANS) 3
11. 11 DIV 4= 2
12. 13 DIV 4 = 3
13. 8 DIV 3 = 2
14. 17 DIV 3 = 5
18. Which is the correct syntax for performing a “DIV or Quotient division” in Python?
ANS) 9//4 = 2
Page 5 of 5