Will your hand calculator and QBasic give the same answer for, say, the square root of 3.00 ?
Probably. One or the other might give you more decimal places of precision, however.
Remember the SOUND statement:
SOUND frequency,duration
In this statement,
A previous program in these chapters used a DO...LOOP
to repeatedly
play a note that the user entered,
but it had to be ended by hitting CONTROL-BREAK.
This was awkward.
Let us re-design the program with a DO WHILE
condition so
that the loop body is executed only when the user enters a
note greater or equal to 37 (in other words, any value less
than 37 is a sentinel value.)
' Do repeatedly: ' Ask the user for a note. ' Play it for about a second. ' . . . do beginning things . . . . PRINT "Enter the frequency (37-32000):" INPUT FREQ DO WHILE FREQ is not a sentinel value . . . do something or other . . . PRINT "Enter the frequency (37-32000):" INPUT FREQ LOOP . . . ending things . . . END
The "beginning things" and the "ending things" blanks do not need to be filled in for this program.
Fill in the blank of the DO WHILE
statement
so that the loop body is executed only when FREQ is greater
or equal to 37.