ZX 81 - BASIC Programming

Sinclair ZX Spectrum
Chapter 8.2 - Computer programming

Exercises

1. Modify the program so that it displays not only the two prices, but also messages to show which is which.

2. Use the EDIT key to change the price of butter.

3. Run the program & then type

PRINT BUTTER, YEAST

The variables are still there, even though the program has finished.

4. Type

12      (& NEWLINE)

Again, the program cursor will be hidden between lines 10 & 15. Now press EDIT, & line 15 will come down: when the program cursor is hidden between two lines, EDIT brings down the second one. Type NEWLINE to clear the bottom part of the screen.

Now type

30

This time, the program cursor is hidden after the end of the program; & if you press EDIT, then line 20 will be brought down.

5. Put a LIST statement in the program so that when you run it, it lists itself.

Sinclair ZX Spectrum

  Previous Page Back Next Page