StudyBrixFree worksheets, study guides and courses

Grade 7 · Computer science

Grade 7 Algorithms & logic worksheet

20 questions on algorithms & logic. The answer key is a separate download.

What is on the worksheet

  1. Using zero-based indexing, what is values[2] for values = [62, 73, 9, 39, 56]?

  2. Start with total = 7. Repeat 5 times: add 12 to total. What is the final total?

  3. FOR i FROM 3 TO 48 INCLUSIVE STEP 5: print i. How many numbers are printed?

  4. FOR i FROM 9 TO 41 INCLUSIVE STEP 8: print i. How many numbers are printed?

  5. Using zero-based indexing, what is values[2] for values = [59, 80, 71, 61, 48]?

  6. Start with total = 79. Repeat 7 times: add 18 to total. What is the final total?

  7. Using zero-based indexing, what is values[0] for values = [38, 22, 86, 22, 41]?

  8. FOR i FROM 15 TO 159 INCLUSIVE STEP 9: print i. How many numbers are printed?

  9. Computing foundations: which term fits this description? A named input in a function definition.

    1. Variable
    2. Parameter
    3. Input
    4. Integer
  10. Using zero-based indexing, what is values[1] for values = [15, 69, 73, 83, 30]?

  11. Using zero-based indexing, what is values[3] for values = [60, 50, 76, 5, 25]?

  12. Using zero-based indexing, what is values[4] for values = [60, 40, 45, 27, 23]?

  13. FOR i FROM 9 TO 153 INCLUSIVE STEP 8: print i. How many numbers are printed?

  14. FOR i FROM 13 TO 115 INCLUSIVE STEP 6: print i. How many numbers are printed?

  15. Using zero-based indexing, what is values[0] for values = [78, 22, 56, 90, 68]?

  16. Convert the binary number 1010100111 to decimal.

  17. FOR i FROM 7 TO 25 INCLUSIVE STEP 9: print i. How many numbers are printed?

  18. Start with total = 28. Repeat 14 times: add 5 to total. What is the final total?

  19. Using zero-based indexing, what is values[4] for values = [9, 89, 68, 64, 2]?

  20. Using zero-based indexing, what is values[0] for values = [86, 98, 57, 76, 91]?

More worksheets like this