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

AQA Pseudocode Worksheet 2

The document is a worksheet for AQA GCSE Computer Science focused on pseudocode exercises. It includes ten tasks that require filling in missing parts of pseudocode snippets related to various programming concepts such as temperature conversion, countdown loops, prime number checking, and more. Each task is designed to help students understand algorithmic thinking and pseudocode structure.

Uploaded by

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

AQA Pseudocode Worksheet 2

The document is a worksheet for AQA GCSE Computer Science focused on pseudocode exercises. It includes ten tasks that require filling in missing parts of pseudocode snippets related to various programming concepts such as temperature conversion, countdown loops, prime number checking, and more. Each task is designed to help students understand algorithmic thinking and pseudocode structure.

Uploaded by

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

AQA GCSE Computer Science: Pseudocode Worksheet 2

Instructions:
Complete each pseudocode snippet by filling in the missing parts. Each task includes a brief description to help you
understand the goal of the algorithm.

1. Temperature Conversion
Convert a temperature from Celsius to Fahrenheit.

OUTPUT "Enter temperature in Celsius:"


celsius ← USERINPUT
fahrenheit ← (celsius * 9 / 5) + ________
OUTPUT fahrenheit

2. Countdown Using WHILE


Print a countdown from 10 to 1 using a WHILE loop.

counter ← 10
WHILE counter ≥ 1 DO
OUTPUT counter
counter ← counter - ________
ENDWHILE

3. Check Prime Number (basic logic)


Check if a number is greater than 1 and not divisible by 2 (basic prime test).

number ← 17
IF number > 1 AND number MOD 2 ≠ 0 THEN
OUTPUT "Probably Prime"
ELSE
OUTPUT "________"
ENDIF

4. Character Count in String


Count the number of times 'a' appears in a string.

text ← "banana"
count ← 0
FOR i ← 0 TO LENGTH(text) - 1 DO
IF text[i] = "a" THEN
count ← count + 1
ENDIF
________ count

5. Reverse a List
Output a list in reverse order.

items ← [1, 2, 3, 4, 5]
FOR i ← LENGTH(items) - 1 TO 0 STEP -1 DO
OUTPUT ________
ENDFOR
6. Password Match Loop
Keep asking for a password until the user enters the correct one.

password ← ""
REPEAT
OUTPUT "Enter password:"
password ← USERINPUT
UNTIL password = ________

7. Add Only Positive Numbers


Sum only the positive numbers in a list.

numbers ← [-2, 4, 0, 7, -5]


total ← 0
FOR i ← 0 TO 4
IF numbers[i] > 0 THEN
total ← total + ________
ENDIF
ENDFOR
OUTPUT total

8. Nested Loop - Multiplication Table


Output a 3x3 multiplication table using nested loops.

FOR i ← 1 TO 3
FOR j ← 1 TO 3
OUTPUT i * j
________
ENDFOR

9. Case Selection Using IF


Output a message based on a grade letter using IF/ELSE.

grade ← "B"
IF grade = "A" THEN
OUTPUT "Excellent"
ELSEIF grade = "B" THEN
OUTPUT "________"
ELSE
OUTPUT "Needs Improvement"
ENDIF

10. Function with Two Parameters


Create and call a function that adds two numbers.

FUNCTION add(x, y)
RETURN x + y
ENDFUNCTION

result ← add(5, ________)


OUTPUT result

You might also like