Grade 8 · Computer science
Grade 8 Algorithms & logic worksheet
20 questions on algorithms & logic. The answer key is a separate download.
What is on the worksheet
An outer loop runs 16 times. Each time, an inner loop prints once on each of 23 iterations. How many prints occur?
An outer loop runs 19 times. Each time, an inner loop prints once on each of 19 iterations. How many prints occur?
Start with total = 43. Repeat 13 times: add 15 to total. What is the final total?
Start with total = 67. Repeat 27 times: add 2 to total. What is the final total?
What is an algorithm?
- A broken computer
- Only a password
- An ordered set of steps to solve a problem
- A type of screen
FOR i FROM 13 TO 69 INCLUSIVE STEP 8: print i. How many numbers are printed?
Start with total = 15. Repeat 18 times: add 12 to total. What is the final total?
Start with total = 44. Repeat 10 times: add 2 to total. What is the final total?
FOR i FROM 7 TO 65 INCLUSIVE STEP 2: print i. How many numbers are printed?
Using zero-based indexing, what is values[4] for values = [43, 42, 26, 37, 38]?
Using zero-based indexing, what is values[3] for values = [13, 1, 45, 96, 35]?
An outer loop runs 15 times. Each time, an inner loop prints once on each of 6 iterations. How many prints occur?
Start with total = 35. Repeat 26 times: add 11 to total. What is the final total?
FOR i FROM 10 TO 50 INCLUSIVE STEP 2: print i. How many numbers are printed?
Convert the binary number 10110100 to decimal.
Convert the binary number 1001111110 to decimal.
Pseudocode: x ← 4; x ← x + 3; x ← 2 × x. What is x at the end?
Computing foundations: which term fits this description? Data or signals produced by a system.
- Debugging
- Output
- Flowchart
- Conditional
Start with total = 26. Repeat 18 times: add 17 to total. What is the final total?
An outer loop runs 17 times. Each time, an inner loop prints once on each of 10 iterations. How many prints occur?
More worksheets like this
Grade 5 Computer science practice
20 questions
Grade 5 Algorithms & logic worksheet
20 questions
Grade 5 Digital literacy worksheet
20 questions
Grade 6 Computer science practice
20 questions
Grade 6 Algorithms & logic worksheet
20 questions
Grade 6 Digital literacy worksheet
20 questions