Chapter 8: Advanced Statements in QBasic- Evaluation
1. Which mode is the default mode in the QBasic editor?
2. Which resolution from the following will display the best quality of an image?
3. Which statement is used to set the mode and resolution of the output screen?
4. 11 is the colour code of which colour?
5. Which direction option is used for drawing a line in the diagonally downward direction towards the left side?
Fill in the blanks using the given words:
1. The higher is the resolution of a screen, the better is the clarity of the graphics displayed.
2. The Text mode allows you to display only text on the screen.
3. The screen mode of the text editor is Text mode.
4. The PAINT statement is used to colour in a graphic.
5. EXIT and GOTO are two unconditional statements.
Write 'T' for true and 'F' for false statements:
1. You can display graphics on the text mode also. F
2. The default colour of a line in QBasic is red. F
3. You cannot use the CIRCLE statement to draw an arc of a circle. F
4. The BEEP statement is used to produce a single sound. T
5. There are 18.2 clock ticks in a second. T
Answer the following questions:
1. What is the difference between the text mode and the graphic mode?
Text mode displays only characters in the form of text, while graphic mode allows display of images, shapes, and colors with higher detail and resolution.
2. Write down the syntax of the LINE statement and explain it:
Syntax: LINE (x1, y1)-(x2, y2), color, [B]
This draws a line from point (x1, y1) to (x2, y2) with the specified color. 'B' optionally fills a rectangle (box) if specified.
3. How can you draw a circle in QBasic of radius 125 pixels and yellow colour?
Use the CIRCLE statement like: CIRCLE (x, y), 125, 14
(where 14 is the color code for yellow)
4. Why are the EXIT and GOSUB statements known as unconditional statements?
Because these statements cause the program to jump to another point in code immediately without checking any condition.
5. Explain the use of the GOSUB... RETURN statement.
GOSUB is used to jump to a subroutine, and RETURN transfers control back to the statement following the GOSUB call.
Define the following terms:
1. Pixel: The smallest unit of a graphic image shown on the screen.
2. Graphics mode: Display mode that supports drawing of images, shapes, and colors rather than just text.
3. CIRCLE statement: A QBasic command used to draw circles or parts of circles on the screen.
4. Sound statements: Commands like BEEP or SOUND used to generate audio effects in QBasic programs.
5. Unconditional statements: Statements such as GOTO and EXIT which force the program to jump to a specified line unconditionally.

0 Comments