Sinclair QL Beginner's Manual page 41

Hide thumbs Also See for QL:
Table of Contents

Advertisement

Controlled
Automated
Synchronised
Functional
Optional
Positive
Balanced
Integrated
Coordinated
Sophisticated
ANALYSIS
We will write a program to produce ten buzzword phrases. The stages of the program are:
1
Store the words in three string arrays.
2
Choose three random numbers which will be the subscripts of the array variables.
3
Print the phrase.
4
Repeat 2 and 3 ten times.
DESIGN - VARIABLES
We identify three arrays of which the first two will contain adjectives or words used as adjectives -
describing words. The third array will hold the nouns. There are 13 words in each section and the
longest word has 16 characters including a hyphen.
DESIGN – PROCEDURES
We use three procedures to match the jobs identified.
store_data - stores the three sets of thirteen words.
get_random - gets three random numbers in range 1 to 13.
make_phrase - prints a phrase.
DESIGN - MAIN PROGRAM
This is very simple because the main work is done by the procedures.
Declare (DIM) the arrays
Store_data
FOR ten phrases
get_random
make_phrase
END
cybernetic
user-friendly
parallel
learning
adaptable
modular
structured
logic-oriented
file-oriented
Standardised
Array
adjec1$(13,12)
adjec2$(13,16)
noun$(13,15)
feedback
transputers
micro-chips
capability
programming
packages
databases
spreadsheets
word-processors
objectives
Purpose
first adjectives
second adjectives
nouns

Advertisement

Table of Contents
loading

Table of Contents