0% found this document useful (0 votes)
8 views2 pages

AQA GCSE Computer Science Algorithms Questions

The document contains a series of algorithm questions related to while loops, for loops, and nested iterations for AQA GCSE Computer Science. It includes tasks such as writing loops for various scenarios, calculating sums, and filling in trace tables for given code snippets. The questions are designed to test understanding of basic programming concepts and iteration techniques.

Uploaded by

staroj17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

AQA GCSE Computer Science Algorithms Questions

The document contains a series of algorithm questions related to while loops, for loops, and nested iterations for AQA GCSE Computer Science. It includes tasks such as writing loops for various scenarios, calculating sums, and filling in trace tables for given code snippets. The questions are designed to test understanding of basic programming concepts and iteration techniques.

Uploaded by

staroj17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AQA GCSE Computer Science: Algorithm Questions

While Loops
1. Write a while loop that prints numbers from 1 to 10.

2. Write a while loop that keeps asking the user to enter a number until they enter -1.

3. Write a while loop to find the sum of all even numbers from 2 to 100.

4. Write a while loop that simulates a simple login system with 3 attempts.

5. Trace table: What will be the output of the following code?

count = 0

while count < 5:

print(count)

count += 1

Fill in the trace table with the values of 'count'.

For Loops
6. Write a for loop that prints all elements in a list of names.

7. Write a for loop that calculates the factorial of a given number.

8. Write a for loop that prints the multiplication table of 5.

9. Write a for loop to find the total of a list of numbers.

10. Trace table: What will be the output of the following code?

for i in range(3):

print(i)
Fill in the trace table with the values of 'i'.

Nested Iteration
11. Write a nested for loop to print a 3x3 grid of numbers.

12. Write a nested loop that prints a multiplication table from 1 to 5.

13. Write a nested loop that prints all combinations of two dice rolls.

14. Write a nested loop that iterates through a 2D list and prints each element.

15. Trace table: What will be the output of the following code?

for i in range(2):

for j in range(2):

print(i, j)

Fill in the trace table with the values of 'i' and 'j'.

You might also like