You are on page 1of 6

1. __________ is sometimes referred to as a container and can just hold one value a time. a.

Pseudocode
b. Data type
c. Variable
d. None of the above

2. Which of the following are valid variable names? (Select all that are valid) a. sNumber
b. iAmount
c. rName
d. None of the above

3. What is true about variable names? (Select all that are valid) a. Can have no spaces
b. Can have no numbers
c. Cannot have symbols
d. It should be descriptive

4. __________ is the act of computing inputted data a. Input


b. Processing
c. Integer
d. Comment

5. Which is a whole number that can be negative or positive and includes a zero a. Data type
b. String
c. Integer
d. None of the above

6. __________ is an attribute of data that specifies the operation that can be performed on it. a.
String
b. Processing
c. Data type
d. Comments

7. __________ are variables that can hold numbers, letters and many more. a. Input
b. Characters
c. Strings
d. Data type
8. What will be the data type of a variable that stores the value: 2.65? Real

9. Which data type would be best to store an Identity Number? String

10. Which data type is suitable for storing both positive and negative whole numbers? Integer

11. Given the following scenario, what will be the input and output. You have been given a task to
screen students as they enter classes (50 per class). You are given an opportunity to decide how
many classes you want to screen. Calculate and display the student’s average temperature per class
as well as the number of students in all classes.

numStudents: Number of students in a class


averateTemperature: average temperature per class
numClasses: number of classes
totalStudents: total number of all students in all groups

N.B. Select all relevant

Input:

Output:

Text is an example of which data type? String

14. ________ are text notes added to the program to provide explanatory information about the
code. a. Processing
b. String
c. Data type
d. Comments

15.

16. Put the following in the correct execution order:


i. Output
ii. Input
iii. Processing

a. i -> ii-> iii


b. ii -> i -> iii
c. iii -> ii -> i
d. ii -> iii -> i

17. Give the exact output of the following pseudocode:


Assume that the user will enter 1000

//Constant
rDiscount = 0.1
//Inputs
ask “What is total amount spent?”
enter rAmount
//processing
rDiscountAmt = rDiscount * rAmount
//Output
display ‘’The discount amount is R“ + rDiscountAmt
display “The total amount is R” + (rDiscountAmt + rAmount)
a. “The discount amount is R“ + 100
“The total amount is R” + (100 + 1000)

b. “The discount amount is R“ 100


“The total amount is R” (100 + 1000)

c. The discount amount is R100


The total amount is R1100

d. The discount amount is R 100


The total amount is R 100+1000

e. None of the above

18. Which of the following is the correct way of displaying a percentage as output? rperc = 50
a. display”The percentage is ” +rperc + %
b. display”The percentage is ” +rperc + “%”
c. display”The percentage is + rperc + %”
d. display”The percentage is ” +rperc %

19. Which of the following is best suitable for asking the user to enter their test mark?
a. display”Enter your rTestMark”

b. display”Enter your rTest Mark”


enter rTestMark

c. display”Enter your Test Mark”

d. display”Enter your TestMark”


enter rTestMark

20. which keyword do we use for requesting input in pseudocode?


a. ask
b. display
c. variable
d. processing

21. which keyword do we use for showing the output in pseudocode?


a. ask
b. display
c. variable
d. processing

22. Give the exact output of the following pseudocode:

This program is for a store that sells everything at a price of R20. The user needs to provide number
of items they have bought. Calculate and display the vat and total amount.

Assume that the user will enter 6

//Constant
rVat = 0.15
rPrice = 20
//Inputs
ask “how many items did you buy?”
enter iNumItems
//processing
rTotalPrice = rPrice * iNumItems
rVat = rVat * rTotalPrice
rAmtDue = rTotalPrice + rVat
//Output
display ‘’The amount due is R“ + rAmtDue + “ and vat amount is R ”+ rVat

a. The amount due is R138 and vat amount is R 0.15


b. The amount due is R 120 and vat amount is R 18
c. The amount due is R120 and vat amount is R0.15
d. The amount due is R138 and vat amount is R 18

24. Your landlord has tasked you to write a program to calculate the cost of rooms based on the
area. He decides to set a standard price of R100 per m 2. For every room, one will need the length
and width in cm. What will be the input?
a. rArea
b. rLength
c. rWidth
d. 100

25. Your landlord has tasked you to write a program to calculate the cost of rooms based on the
area. He decides to set a standard price of R100 per m2. For every room, one will need the length
and width in cm. What will be the output?

a. rWidth
b. rLength
c. rCost
d. rArea?

26. Your landlord has tasked you to write a program to calculate the cost of rooms based on the
area. He decides to set a standard price of R100 per m2. For every room, one will need the length
and width in cm. What will be the correct processing calculations?

a. rArea = rLength + rWidth /100


b. rArea = rLength * rWidth
c. rArea = rLength * rWidth /100
d. rArea = rLength * rWidth /1000

27. Your landlord has tasked you to write a program to calculate the cost of rooms based on the
area. He decides to set a standard price of R100 per m2. For every room, one will need the length
and width in cm. What will be the constant?
a. rArea
b. 100
c. rWidth
d. rLength

28. Write a statement that will display the following output in pseudocode:

Hi, Karabo. Welcome to the PPAF05D class. Enjoy!!!


Where sName = “Karabo”

Answer:

29. The data that the user provides/ enters is called?


Answer:

30. The results displayed by a program post processing is called?


Answer:

31. A/an _________ is sometimes referred to as a fixed value.


Answer:
32. A/an _________ is referred to as a procedure used in solving problems. A pseudocode is one
representation of it.
Answer:

You might also like