Transcript Arrays

1.
2.
Understand the application of Pseudo Code
for programming purposes
Be able to write algorithms in Pseudo Code



It’s a bit of a middle ground between English
and a programming language
It’s non-language specific, this means it’s
not meant to have any of the language
syntax
Used as a tool to help planning
Variables
Output
name  “Tom”
print name
Variables are simply
assigned by using an
arrow sign towards
the variable
There is no need to
put brackets in for
printing something
to the screen, only
exception would be
for mathematical
equations.
If statements
Iteration
If i is divisible by 5 then
print “Buzz”
End
for i = 1 to 100 do
Your code in here
end
If statements follow the
same principles as if you
are coding, however in
the logic section you
need to explain what you
are testing for.
Once again very similar
to code, however you
need to specify how
many loops you are
making
Passes <- zero
Failures <- zero
Student <- one
while student counter is less than or equal to ten
input the next exam result
if the student passed
add one to passes
else
add one to failures
add one to student counter
end
end
Print passes
Print failures
if eight or more students passed
print "raise tuition”
Write pseudo code to show how you would use a for
loop to print out a list of numbers from 1 to 10.
Write a program in pseudo code to count the number of
words in a sentence. The user enters a sentence. The
program will output the number of words in the sentence.
Write pseudo code that will work out the distance
travelled if the user enters in the speed and the time.
Extension – allow the user to enter either mph or kph.
Bonus Challenge
Make a game of rock, paper scissors against
the computer in pseudo code