Apple IIe User Manual
Page 37
Page 37 of 74
IIe
Printed: Tuesday, March 4, 2003 10:40:15 AM
90
END
Signals the end of the program.
Once you've typed the program, you can try it by typing:
RUN
Here's what you'll see:
THIS PROGRAM CONVERTS MILES TO KILOMETERS. HOW MANY MILES DID YOU TRAVEL? 3 YOU TRAVELED
4.82804127 KILOMETERS.
Spacing?
If the spacing on your screen isn't exactly right, you may have forgotten to type a space
inside one of the PRINT statements.
To retype a line, type the line number of the line you
want to correct, then type the new statement.
You can save this program on your newly formatted disk by typing SAVE followed by a name, like
KILO.
Then, when you want to load the program, simply type RUN KILO.
Write Your Own Conversion Programs:
You can use PRINT and INPUT statements (and this program as a guide) to write programs that
convert any measurement you can think of (as long as you know the conversion formula).
Try
Celcius to Fahrenheit or inches to millimeters.
Crazy Sentences
This program uses INPUT statements to create a silly story.
Each time you run the program, the
sentence the program creates will be a little different (unless you always type the same
responses).
Don't Forget to Clear Memory:
Before you try another program, don't forget to clear the computer's memory by typing NEW.
Program Line
Explanation
10
PRINT COLOR
Prints a request for a color. the semicolon tells
the computer not to go on to the next line.
20
INPUT C1$
Displays ? on the screen.
Whatever color you type
is stored in the variable C1$ (pronounced
see-one-dollar's). The word color cannot be used as
a variable name because it's an Applesoft BASIC
reserved word.
30
PRINT ANOTHER COLOR
Prints a request for a second color.
40
INPUT C2$
Displays ? on the screen.
Whatever color you type
is stored in the variable C2$.
50
PRINT NAME
Prints a request for a name.
60
INPUT N1$
Displays ? on the screen.
Whatever name you type is
stored in the variable N1$.
70
PRINT ANOTHER NAME
Prints a request for a second name.