Pseudocode Basics
Pseudocode Basics
Age = 14
Age ← 14
First_Name ← “Name”
Last_Name ← Names_Collected
Equal to - = //in python it would be ==, one = sign in python be the equivalent of ← assigning a
piece of data
Write a program that compares two different numbers. If number 1 is bigger than number two,
we want the program to output “number 1 is bigger”, otherwise we want them to enter the
number again until number 1 is bigger than number 2.
Num1 ← INPUT “Enter a number”//this is how to to setup a variable.
Num2 ← INPUT “Enter a number”
IF Num1 > Number2
OUTPUT “number 1 is bigger”
ELSE
OUTPUT “number 1 is not bigger than number 2, try again”
Num1 ← INPUT “Enter a number”
Loops
,
WHILE X != 0 THEN
N ← X * X/(1 – X)
X -= 1
OUTPUT N
DECLARE Identifier ← [ ]
DECLARE Names ← [ ]
To add a new name to the array, you would use one of the following:
Name ← USERINPUT “Enter your name”
Names ← Names + Name //add the variable after the array name
Names.APPEND(Name)