Language SPC
| Date: | 05/28/06 |
| Author: | Ronald S. Brown |
| URL: | n/a |
| Comments: | 0 |
| Info: | RonBrown@WeBeatDiabetes.com |
| Score: |
SPC version
Title: 99_bottles
Filename: bottles.sud
Version: 1.3
Author: Ronald S. Brown
Created-date: 27May2006
Revised-by: Ronald S. Brown
Revision-date: 28May2006
Purpose: To display the lyrics
of the song "99 Bottles
of Beer on the Wall".
Category: Curiosity/Benchmark
Needs: Minimal
DataDictionary:
bottle_count control counter for the program's single loop
step increment/decrement amount for loop control counter
bottle_of_beer "bottle of beer"
bottles_of_beer "bottles of beer"
on_the_wall "on the wall."
period "."
take_one_down "Take one down and pass it around."
take_it_down "Take it down and pass it around."
no_more "No more"
go_to_the_store "Go to the store and buy some more."
Procedure:
LOOP START WITH bottle_count EQUALS 99 and step EQUALS MINUS 1
TEST bottle_count GREATER THAN 1
TRUE
DISPLAY bottle_count bottles_of_beer on_the_wall
DISPLAY bottle_count bottles_of_beer period
DISPLAY take_one_down
DISPLAY bottle_count MINUS 1 bottles_of_beer on_the_wall
TEST bottle_count EQUALS 1
TRUE
DISPLAY 1 bottle_of_beer on_the_wall
DISPLAY 1 bottle_of_beer period
DISPLAY take_it_down
DISPLAY no_more bottles_of_beer on_the_wall
TEST bottle_count LESS THAN 1
TRUE
DISPLAY no_more bottles_of_beer on_the_wall
DISPLAY no_more bottles_of_beer period
DISPLAY go_to_the_store
DISPLAY 99 bottles_of_beer on_the_wall
END LOOP ON bottle_count LESS THAN 0
COMMENT 'Standardized' PseudoCode is LOGIC without SYNTAX.
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments