| Tool |
Pseudocode |
JavaScript |
|
New Program
|
Create a program called
name by
author
that does purpose
on date
|
""" name
author
date
purpose
"""
|
|
New Variable |
Make a variable called
name
of
type
type
starting with the value
init
that does
purpose
|
name = init #type, purpose
|
|
output
|
output the value
value to the user
|
print value
|
|
input |
ask the user
question
and store response in
variable
|
variable = raw_input(question)
|
|
assignment |
assign
value
to variable
|
variable = value
|
|
to integer
|
force
variable
to be converted to an integer
|
variable = int(variable)
|
|
to upper case
|
convert
stringVar
to upper case
|
stringVar = stringVar.upper();
|
|
random |
place a random real number between 0 and 1 in
variable
|
variable = random.random()
(requires import random statement at top)
|
|
if branch
|
if
variable
comparison
value
|
ifvariable comparison value:
# indented code lines happen if condition is true
|
|
for loop
|
for
counter goes from
start
to
finish
stepping by
inc
|
for counter in range(start, finish + 1, inc):
# indented code lines happen in loop
|
|
while loop
|
while
variable
comparison
value
|
while variable comparison value:
# indented code lines happen as long condition is true
|