[go: up one dir, main page]

0% found this document useful (0 votes)
10 views12 pages

Unit 1 - Pseudocode and Flowcharts revision [ARA] v2

The document provides a series of exercises focused on pseudocode and flowcharts, including filling in blanks for pseudocode, creating pseudocode for specific programs, and answering questions about flowchart behavior. It also includes tasks to create flowcharts based on provided pseudocode and to write a Python program that outputs the square of numbers. Additionally, it presents a challenge to modify the program to output squares from 1 to 10.

Uploaded by

quan001438
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)
10 views12 pages

Unit 1 - Pseudocode and Flowcharts revision [ARA] v2

The document provides a series of exercises focused on pseudocode and flowcharts, including filling in blanks for pseudocode, creating pseudocode for specific programs, and answering questions about flowchart behavior. It also includes tasks to create flowcharts based on provided pseudocode and to write a Python program that outputs the square of numbers. Additionally, it presents a challenge to modify the program to output squares from 1 to 10.

Uploaded by

quan001438
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/ 12

Unit 1 – Pseudocode and Flowcharts revision

1 Fill in the blanks to create the pseudocode for the following python
program.

OUTPUT "This is loop", i i>3 i = 0 TO 4


START
FOR _i = 0 TO 4_____
IF __ i > 3 ____ THEN
OUTPUT "This is loop", i, "Iterations complete"
ELSE
_______OUTPUT "This is loop", i ______________
ENDIF
ENDFOR
STOP

2 Create the pseudocode for the following program.

START
FOR i = 0 TO 2
favsubject = INPUT “ What is one of your favorite subjects?
OUTPUT favsubject
ENDFOR
STOP
3 The following is a flowchart and its matching pseudocode. Answer the
questions below.

a. What happens when the condition i<3 is false?


Stop
b. How many times does the algorithm loop?
3 times

c. What is the name of the variable storing the input from the user each time
the algorithm loops?
favSubject

d. Modify the pseudocode so it only asks for 2 favourite subjects instead of 3.

i=1
4 Following the previous example, create a flowchart for the following
pseudocode (this algorithm counts from 0 to 9).
START
FOR i = 0 TO 9
OUTPUT i
ENDFOR
STOP

Insert your flowchart:

https://drive.google.com/file/d/1v6tZnauJfEF4FvzP5H4UjguX3t7oFw_n/view?
usp=sharing
5 Create the pseudocode and flowchart for a program that will output every
number multiplied by itself from 0 to 9.

Type your pseudocode:


START
FOR i = 0 to 10
OUTPUT i = i*i
i = i +1
ENDFOR
STOP

Insert your flowchart:


https://drive.google.com/file/d/11F9t1AQKCu5Ed74aT4c0jPxJ88V1_XS2/view?
usp=sharing

Challenge (optional) – Create the previous program into python. Modify it


so the output is every number from 1 to 10 multiplied by itself.

Insert your python program below:


Solutions
1 Fill in the blanks to create the pseudocode for the following python
program.

OUTPUT "This is loop", i i>3 i = 0 TO 4


START
FOR i = 0 TO 4
IF i > 3 THEN
OUTPUT "This is loop", i, "Iterations complete"
ELSE
OUTPUT "This is loop", i
ENDIF
ENDFOR
STOP

2 Create the pseudocode for the following program.

OUTPUT "This is loop", i i>3 i = 0 TO 2


START
FOR i = 0 TO 2
favSubject = INPUT "What are your favorite subjects?"
OUTPUT favSubject
ENDFOR
STOP
3 The following is a flowchart and its matching pseudocode. Answer the
questions below.

a. What happens when the condition i<3 is false?


🡪 The loop does not run and the algorithm stops.
b. How many times does the algorithm loop?
🡪 3 times
c. What is the name of the variable storing the input from the user each time
the algorithm loops?
🡪 favSubject
d. Modify the pseudocode so it only asks for 2 favourite subjects instead of 3.
4 Following the previous example, create a flowchart for the following
pseudocode (this algorithm counts from 0 to 9).
START
FOR i = 0 TO 9
OUTPUT i
ENDFOR
STOP

Insert your flowchart:


5 Create the pseudocode and flowchart for a program that will output every
number multiplied by itself from 0 to 9.

Type your pseudocode:


START
FOR i = 0 TO 9
OUTPUT i*i
ENDFOR
STOP

Insert your flowchart:


Challenge (optional) – Create the previous program into python. Modify it
so the output is every number from 1 to 10 multiplied by itself.

Insert your python program below:


for i in range(0,11):
print(i*i)

You might also like