New variable
- Name: what do we call this thing?
- Type: what type of data does it contain?
- InitVal: what is it’s starting value?
- New variable algorithm
o Create a variable called name of type
o Type that starts with the value initVal
Output
- Message: text to write to user
- Output algorithm
o Output the text message
Input
- Variable: where answer from user will be stored
- Message: question being asked of the user
- Input algorithm
o Ask the user message and store the answer in variable
For loop
- Sentry: integer variable that will control loop
- Start: integer value of sentry at beginning
- Finish: integer value of sentry at end
- Change: integer to add to sentry at each pass
- For algorithm
o Begin with sentry at start and add
o Change to sentry on each pass until
o Sentry is larger than or equal to finish
While loop
- Sentry: variable that will control loop
- Initialization code: code that initializes sentry
- Condition: loop repeats if condition is true
- Change code: code to change sentry so condition can be triggered
- While loop algorithm
o Initialize sentry with initialization code
o Then continue loop as long as condition is
o True. Inside loop, change sentry with
o Change code