Answer the following questions:-
1) Write the steps for writing and running a program in QBASIC?
2) Write the steps for saving a program in QBASIC?
3) What rules should be followed while naming a file?
4) What is the function of the Paint command in QBASIC?
5) What is the minimum and maximum frequency range of sound produced through QBASIC programs?
Answers
Answer:
Answer 1
To run QBASIC we need to get to DOS.
Step 1: Hit the Enter key (or any other) to return to the QBasic window 2D.
(Alternative) Run the program by using the menu system.
Step 2: Tap the Alt key on the keyboard.
Step 3: Tap the R key. The Run menu will appear: 2E.
Answer 2
In PC, select the Save As option and press Enter key to save a program.
Answer 3
All file names are case sensitive. So filename vivek.txt Vivek.txt VIVEK.txt all are three different files.
You can use upper and lowercase letters, numbers, “.” (dot), and “_” (underscore) symbols.
You can use other special characters such as blank space, but they are hard to use and it is better to avoid them.
In short, filenames may contain any character except / (root directory), which is reserved as the separator between files and directories in a pathname. You cannot use the null character.
No need to use . (dot) in a filename. Some time dot improves readability of filenames. And you can use dot based filename extension to identify file.
Answer 4
- To use PAINT, there must be a SCREEN command declared.
- The command has coordinates that tells QBasic where to start.
- The color number specifies the color to paint with, and the bordercolor tells the PAINT command that it should not paint further when it encounters a pixel of that color.
Answer 5
- Human ear cannot detect sound frequencies less than 20 vibrations per second i.e. 20 Hz.
- So any sound below this frequency will be inaudible sound for humans.
- In the high-frequency range, the human ear cannot detect frequencies above 20000 vibrations per second (20 KHz) and the amplitude of the wave would be depending on the loudness of the sound.