Chapter – 7 Graphics in QBasic
Chapter - 7 Graphics in QBasic
Buzz Keyword
1. Constants:- Data whose value does not change or remains fixed during the execution of the program.
2. Variables:- Name that represents location in the computer’s memory, which stores the values.
3. CLS:- This stands for Clear Screen.
4. PRINT:- PRINT statement is used to display the output of the program.
5. END: The END command indicates the end of the program.
6. INPUT:- Input command is used to accept values from the user for the variables.
7. IF…THEN:- This statement is used to check conditions in the program.
8. COLOR:- The COLOR statement is used for foreground colour and background colour
9.DRAW:- This command is used to draw a straight lines in any direction.
10. PSET:- This command is used to set pixels at any specific location on the screen.
11. LINE:- LINE statement allows to draw a line between two points.
12. CIRCLE:- CIRCLE statement is used to draw a circle on the QBasic output screen.
13. PAINT:- The PAINT statement is used to fill colour in the CIRCLE.
Fill in the blanks.
1. INPUT command is used to accept values from the user for the variable.
2. We can draw a Box by adding the letter B at the end of the LINE command
3.The PAINT statement is used to fill colour in the CIRCLE.
4. PLAY command lets you play the music notes in QBasic.
5. CLS stand for clear screen.
State whether True or False.
1. String variables are followed by the $ sign. True
2. In Screen statement I is the default mode. False
3. The COLOR statement takes only one number. False
4. To fill colour inside the Box, we use BE True
5.Screen 13 supports only 2 colours. False
Multiple Choice Questions.
1. INPUT command generates this symbol on the output screen.
(i) Dollar ($)
(ii) Hashtag (#)
(iii)Question Mark (?)
(iv) Percentage (%)
2. We can make the test blink by adding the number _________ to the color number.
(i)15
(ii)16
(iii)17
(iv)18
3.The commands which help to produce sound in QBasic are
(i) Beep Sound, Play
(ii) Beep, Voice, Music
(iii)Volume. Sound, Play
(iv) Beep, Sound, Volume
4. We use these commands to draw a Circle filled with Colour
(i)CIRCLE ,COLOR
(ii) CIRCLE, PAINT
(iii)CIRCLE, FILL
(iv) CIRCLE, BRUSH
5. The QBasic program is saved with the extension
(i) .bas
(ii) .qb
(iii). basic
(iv) .qba
Match the following
Answer briefly
1. What does QBasic stand for?
Ans :- BASIC stands for Beginner’s All Purpose symbolic Instruction Code.
2.How can the INPUT command be used to accept multiple variables?
Ans :- The INPUT command can also input values for a list of variables. The variable names should be separated by commas (,).
3. What are variables?
Ans :-Name that represents location in the computer’s memory, which stores the values.
4. How can the text blink in the QBasic output screen?
Ans :- We can make the text blink, by adding the number 16 to the colour number.
5. Write the command to draw a BOX using the LINE command.
Ans:- LINE(200,50)-(100,200),B
6.Which are the commands that can be used to produce sound in QBasic?
Ans:- Beep, Sound and Play
Answer the following.
1.How are constants and variables different from each other?
Ans :- Variables: Data whose values are not constant and may change due to some calculations during the program execution.
Constants: Data whose value does not change or remains fi xed during the execution of the program are constants
2. What are constants? Explain its types.
Ans :- Data whose value does not change or remains fi xed during the execution of the program are constants.
Types:1. Numeric Constants: These are numbers that can be Integers or Real Consonants.
They are used for mathematical calculations. Character constants: These are characters but can also contain numbers. No mathematical calculations can be performed on Character consonants. These can be single character or
multi character – Strings.
3. Describe the types of variables.
Ans :-Types of variables: 1. Numeric Variable- Numeric variable holds Numeric values (Integers and Real)for arithmetic calculations.(+,-,*./).
String Variable: String variable holds letters, special characters and space. These are
represented by a letter followed by the $ sign.
4. What is the significance of If…Then…Else statement?
Ans :- IF…THEN…ELSE provide statements to be executed for the False condition as well.
Syntax: IF<condition>THEN<statement>ELSE<statement>END IF
5. Give the syntax of each of the followings
(i)CIRCLE
(ii) LINE
(iii) BOX
(iv) PAINT
Ans :-CIRCLE Syntax: CIRCLE (X, Y), R, COLOR
LINE Syntax: LINE(X1, Y1)-(X2, Y2), COLOR
BOX –LINE(X1, Y1)-(X2, Y2), COLOR, B
PAINT Syntax: PAINT(X, Y), COLOR1, COLOR2
6.Write a program to draw a line diagonally in downward direction towards right side.
Ans :- SCREEN 1
CLS
COLOR 4,15
DRAW“F100”
END
7.What is the use of PSET command?
Ans :- The PSET command is used to set the pixels at any specifi c location on the screen. The
syntax of the PSET command is Syntax: PSET (x,y)
‘x’ represents columns and ‘y’ represents rows.
Popular Videos
UX for Teams
Learn the basics and a bit beyond to improve your backend dev skills.
Designer
SEO & Instagram
Learn the basics and a bit beyond to improve your backend dev skills.
Designer