Iteration
Iteration
( FOR TO NEXT)
CASE OF OTHERWISE
REVIEW
Agenda
FOR TO NEXT
2
9/3/20XX Presentation Title 3
CASE OF
OTHERWISE
8
FOR TO NEXT
9
Design a program using
loops that takes 5
numbers from the user.
Calculate and display the
total of these numbers.
10
Answer
11
Write pseudocode
that reads 100
numbers and prints
out their average.
12
Answer
13
Write pseudocode
that inputs 50
numbers and counts
the numbers that are
greater than 100.
14
Answer
15
Differences between REPEAT ...
UNTIL and WHILE ... DO ...
ENDWHILE
WHILE.. DO .. ENDWHILE REPEAT.. UNTIL
16
WHILE DO
ENDWHILE
Pseudocode
WHILE .. DO …ENDWHILE
18
Design a program that
will read the side
length of a square and
displays its area.
Area = side * side
Repeatedly display an
error message and ask
the user to re-enter the
side length if the side
length is negative.
20
Design a program that
takes a mark from the
user and validates that
mark.
21
Answer
22
23
Design a program that
would read numbers
until the user enters 0.
Display the total (sum)
of those numbers
24
Answer
25
Design a program
that takes a mark
from the user and
validates that mark.
Display
whether the student
has passed or failed.
Quiz is out of 100.
26
Answer
27
REPEAT UNTIL
Pseudocode
REPEAT .. UNTIL
29
Design a program
that takes from the
user a radius and
the program outputs
the
circumference
Circumference = 2 * π *
Radius
30
Answer
31
Design a program,
using pseudocode only,
which asks the user to
enter his age and
displays on the screen
You’re a teenager if the
user is younger than
20 years, and
displays on the screen
You’re an adult
otherwise.
Age can’t be less than
1
Age can’t be more than
100
32
Answer
33
RECAP
34