NEW
Font size
WorksheetsProgramming Basics Worksheet
Total questions: 26
Worksheet time: 13mins
What does the term pseudocode mean in programming?
Code written in a specific programming language that the computer can run directly
A set of mathematical formulas only
A way of writing instructions in plain, simple language that looks like code but is not real code
A type of loop used in algorithms
Which construct would you use to check if a student passed (score ≥ 50)?
Sequence
Selection
Iteration
Variable declaration
Variables should be named clearly to show their purpose.
True
False
In sequence, steps might run in any order the computer decides.
True
False
Selection lets a program choose between two or more paths.
True
False
What does this loop print?
Hi (once)
HiHi
HiHiHi
Nothing
In if age >= 18 then print("Adult") if age = 18, output is:
Minor
Adult
18
Error
What will this print? x = 2 y = x * 3 print(y)
2
3
5
6
Which statement is Loop?
if score >= 90 then grade = "A"
for i in range (1 , 5): print(i)
x = 10
grade = "B"
Which line is selection?
repeat 10 times
if temp > 30 then print("Hot")
x = x + 1
print("Done")
Which statement is selection?
repeat 10 times
if temp > 30 then print("Hot")
x = x + 1
print("Done")
Which statement shows sequence?
Steps run in order from top to bottom
Repeating steps while a condition is true
Choosing between alternatives
Jumping to random steps
What is the purpose of assignment in x = 5?
Checks if x equals 5
Sends 5 to the screen
Stores the value of the variable 5 in x
Adds x and 5
A variable is best described as:
A fixed value that never changes
A named storage location that can hold a value
A mathematical symbol only
A type of loop
Which of the following is the best data type to store a student’s name?
Integer
String
Boolean
Float
Which statement about pseudocode is correct?
It must be written in a programming language
It is only used by computers
It is a simple way for humans to plan code using plain language
It cannot be changed once written.
17. Decomposition is breaking down problems into _________.
subproblems
algorithms
variables
loops
Computer programming is writing codes to solve computing problems
صواب
خطأ
Name and Age of the user are not variables
True
False
Which construct is used when you want the program to make a decision?
Sequence
Selection
Repetition
Loop
Print ("Welcome") is an example of :
Output
Input
Input and Output
22. Int_Age= input("Enter your Age") is an example of :
Input
Output
Input and Output
23. Score) is an example of a Variable)
Yes
No
A compound conditional uses more than one condition connected with logical operators.
Yes
No
Which of the following is an example of a compound conditional?
if x > 10:
if x > 10 and y < 5:
print(x)
What is the main difference between selection and Loop?
Selection repeats steps; iteration chooses between options
Selection chooses between options; Loop repeats steps
