| Tool |
Pseudocode |
JavaScript |
|
New Program
|
Create a program called
name by
author
that does purpose
on date
|
function main(){
// author, date, purpose
|
|
New Variable |
Make a variable called
name
of
type
type
starting with the value
init
that does
purpose
|
var name = init; //type, purpose
|
|
output
|
output the value
value to the user
|
alert(value);
|
|
input |
ask the user
question
and store response in
variable
|
variable = prompt(question);
|
|
assignment |
assign
value
to variable
|
variable = value;
|
|
to integer
|
force
variable
to be converted to an integer
|
variable = parseInt(variable);
|
|
to upper case
|
convert
stringVar
to upper case
|
stringVar = stringVar.toUpperCase();
|
|
random |
place a random real number between 0 and 1 in
variable
|
variable = Math.random();
|
|
if branch
|
if
variable
comparison
value
|
if(variable == value){
//code
} // end if
|
|
for loop
|
for
counter goes from
start
to
finish
stepping by
inc
|
for(counter = start; counter <= end; counter += inc){
//code
} // end for
|
|
while loop
|
while
variable
comparison
value
|
while(variable == value){
//code
} // end while
|