Font size
WorksheetsLesson 5 review
Total questions: 25
Worksheet time: 8mins
distanceToSchool = 10
Which part is the identifier?
What would the program output with the following inputs?
Payrate - 12
Hours Worked - 10
12
Final pay
OUTPUT
120
What are the two main categories of loop?
Count & Condition (Event) Controlled
Count & For Controlled
While & Event Controlled
Event & Selection Controlled
We need variables to:
store and manipulate data.
store data.
manipulate data.
make fun of students.
We need to give a variable a name so we can...
assign and retrieve values from memory.
be cool.
read code.
know what we're doing.
Which of the following correctly assigns a value to an integer variable?
STORE '5' IN x
STORE 5 IN x
INPUT x IN '5'
STORE x IN 5
A string is a collection of characters and also a data type (i.e. it tells us the type of data that can be stored in a variable). What kind of data can be stored in a STRING datatype?
It can store a sequence of numbers.
It can store a sequence of characters.
It can store a sequence of letters.
All of the above.
Char is short for character, what type of data can be stored in a CHAR datatype?
A datatype that can hold any single character.
A datatype that can hold only numbers.
A datatype that can be ignored.
A datatype that can fit 7.
State the data type of the variable MyName
MyName = "Dhoni"
CHAR
STRING
INTEGER
REAL
Honestly , I don't know
What type of statement is demonstrated in the following example?
MyName = "Bill Gates"
Sequence
Selection
Iteration
Assignment
Honestly , I don't know
What type of data is being stored in the variable called Gender? Please refer to the statements below.
Gender = "F"
Gender = "M"
STRING
ARRAY
CHAR
INTEGER
Honestly , I don't know
What will be the output of the following code?
A = 23
B = 12
C = 2
D = (A+B) * C
PRINT D
47
35
70
140
Honestly , I don't know
What will be the output for the following code?
A = 9
B = 1
C = 2
D = 3
E = A * C + B * D - A / D
PRINT E
21
17
19
18
Honestly , I don't know
What will be the output for the following code?
A = 9
B = 1
C = 2
D = 3
E = A *( C + B )* (D - A) / D
PRINT E
Error
-3
-54
4
Honestly , I don't know
A control structure which a statement or block is executed until the program reaches a certain state, or operations have been applied to every element of a collection.
sequence
iteration
selection
none of the above
___________ is used to denote when a user has to give something to a program.
GET
OUTPUT
INPUT
GIVE
____________ is used by programmers to display information from the screen to the user.
START
SHOW
INPUT
OUTPUT
Which statement correctly indicates that 5 pieces of data will be entered into the computer?
INPUT 1,2,3,4,5
INPUT A,B,C,D,E
INPUT 1,2,A,B,C
INPUT 1A,2B,3C,4D,5E
Which statement below demonstrates the correct use of a psuedocode input statement to get someone's age?
INPUT age
INPUT "age"
age <- INPUT
age = INPUT
Which statement below demonstrates the correct use of a psuedocode output statement to get someone's age?
OUTPUT "age"
OUTPUT age
age <- OUTPUT
age = OUTPUT
Which statement below demonstrates the correct use of a psuedocode assignment statement to store someone's age?
age = 0
age == 0
0 <- age
age <- 0
