Professional Documents
Culture Documents
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
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
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.
Input:
Output:
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.
//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)
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”
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.
//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
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?
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:
Answer: