Answer:

' Ask the user for a note.
' Play it for about a second.
PRINT "Enter the frequency (37-32000):"
INPUT FREQ
SOUND FREQ, 18
END

The prompt that the PRINT statement writes to the monitor reminds the user about the range of values that can be input.

Adding a Loop

This is almost a practical program. You can use it to test if you can hear the difference between 440 Hertz and 441 Hertz. But it is awkward to have to start up the program for each note. It would be nice if it kept on running, repeatedly asking for the frequency, then playing the note.

QUESTION 23:

Write a program where the PRINT, INPUT, and SOUND statements of the above program form a loop body that is endlessly repeated.