DAV Class 8 Computer Chapter 7 Programming with QBasic Question Answer Notes
DAV Class 8 Computer Chapter 7 Programming with QBasic Question Answer Notes Solution by Expert Computer Teacher. DAV Class 8 Computer 7th Chapter Programming with QBasic for Students of DAV Schools.
(Q1) Multiple Choice Questions:-
(1) Q basic stands for _______.
(a) Quickly Beginning for All-Purpose Symbolic Instruction Code
(b) Quick Beginners for All-Purpose Symbolic Instruction Code
(c) Quick Beginners for All-Purpose Symbolic Informative Code
(d) All of these
Ans: (b) Quick Beginners for All-Purpose Symbolic Instruction Code
(2) Q Basic is an ________ developed by Microsoft.
(a) Internal Developed Environment (IDE)
(b) Instantly Developing Environment (IDE)
(c) Integrated Developing Environment (IDE)
(d) Integrated Development Environment (IDE)
Ans: (d) Integrated Development Environment (IDE)
(3) In Q Basic commands or instructions are called as
(a) Statements
(b) Variables
(c) Constants
(d) Keywords
Ans: (a) Statements
(4) Keywords are also called as _________ words.
(a) Unreserved
(b) Booked
(c) Appointed
(d) Reserved
Ans: (d) Reserved
(5) In Q Basic it has a place in computer memory which has a name and stores data temporarily.
(a) Variables
(b) Strings
(c) Keywords
(d) Constants
Ans: (a) Variables
(Q2) State whether the following statements are True or False:-
(1) Statements should be written in accordance with the specific set of rules of the language, which are called Syntax. True
(2) A character set is a defined as set of symbols used by programming language. True
(3) Constants are the data or the values which can be changed during the execution of the program. False
(4) Operators are the symbols that indicates the type for operation Q Basic has to perform on the data or on the values of variables. True
(5) Logical operators are sued to connect two or more relational expressions and returns a TRUE or FALSE value to be used in a decision. True
(Q3) Match the following:-
Sr. No |
Relational Operator | Meaning | Answers |
1) | = | Greater than or equal to |
Equal to |
2) |
> | Not equal to | Greater than |
3) | < | Lesser than or equal to |
Less than |
4) |
<= | Equal to | Lesser than or equal to |
5) | >= | Less than |
Greater than or equal to |
6) |
< > | Greater than |
Not equal to |
(Q4) Answer the following questions in one or two sentences each :-
(1) What is Q Basic?
Ans :- QBASIC stands for Quick Beginners All-Purpose Symbolic Instruction Code. It is an Integrated Development Environment (IDE) which is created by the Microsoft company. QBASIC was been created for typing, editing, debugging and executing/running the BASIC language programs.
(2) What is a Statement
Ans :- The commands or the instructions which are given in Q BASIC at the time of writing the programs is to be termed as the Statement.
(3) What is a Syntax
Ans :- It is the set of rules in BASIC language which helps in writing the statements according to it, is to be termed as Syntax.
(4) Name the basic elements which is helpful in writing a program.
Ans :- There are basically 5 elements which are involved/helpful in creating the Q BASIC program are
(a) Set of Characters
(b) Keywords
(c) Constants
(d) Variables
(e) Operators and Expressions
(5) What do you mean by Character Set
Ans:- It is the set of symbols which is mostly used by the programming language. This symbols are used as the Character set by the Q Basic.
Alphabets |
A, B, C, D, E, F ……….. |
a, b, c, d, e, f …………. | |
Numbers | 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 |
Special
Characters |
! , @, #, $, % ……………. |
(6) What are Keywords
Ans:- In QBASIC there are some words that have special meanings which are known as Keywords. Reserved words is the another term used for Keywords. Some of the reserved words are CLS, REM, INPUT, LET, PRINT, FOR, NEXT, IF, THEN, ELSE, ELSEIF, END. MIDS,ASC, SQR, LEN, LEFTS, TIMES INT etc. The user/ programmer cant make use of these reserved words as the constants or variables.
(7) What is an Operator
Ans:- Operators are the types of symbols which gives an idea about what type of operation will be performed by QBASIC on the entered/given variable data or on the values.
(8) Write down the advantages of QBASIC language programs
Ans:- The advantages of QBASIC language are given below :-
(a) This language is very simple/easy to use and learn
(b) It is available free and works on almost on all the computers.
(c) The rules for using the language is very simple.
(d) GW BASIC, BASICA, QBASIC, and QB64 are some of the recent editions of the QBASIC language.
(Q5) Answer the following questions in brief:-
(1) What is a Constant? Explain the types of categories
Ans:- The data or values in the program which cannot be changed at the time of program’s execution is termed as Constants. A character, word. Number or special characters etc. can be defined as the Constants. If incase, there is a need of using the variable in more than one expression or statement, then the constant is being stored in the variable. In QBASIC, there are two types of Constants which are been explained below
(a) String Constant:- String constants are the letters, words, numbers, numbers , or the letters combined with the numbers or special characters which should be always written in the double quotation marks. You cannot do any mathematical operations on the String Constants. The examples of String Constants are “B” , “APPLE”, “SYMBOL NO:10205”, ”!!!”, “Welcome to QBASIC World !!!”, etc.
(b) Numeric Constant:- This constant is related with the numbers. The number
Which has a decimal point or don’t have, is termed as Numeric Constant. There is no need of using separators in the numeric constants and should not be written in double quotation marks. Logical and Mathematical tasks can be done on numeric constants. The examples of numeric constants are 101, 105.50, 720, 45603, etc.
(2) Write the note on Variable
Ans:- In the computer memory it has its place with name and stores the data on the temporarily basis. It only stores the data which is required in the program. There are different number of variables in every programs and variables values can be easily at the time of program execution. There are two types of variables which are:-
(a) String Variable :- The string variable only stores the string data (viz is string constant). It is always declared by the name followed by the dollar sign. For ex:- Name $, address $, etc.
(b) Numeric Variable :- This variable only stores the data that is in the form of numbers (numeric constant). For ex:- Age %, Marks, Number 1, Number2 etc.
There are some rules that is to be followed while naming a variable which are:-
(a) Always start the variable name with the letter.
(b) There can be inclusion of alphabets and numbers in the variables name.
(c) No other special character is allowed in the variable name except underscore (_)
(d) If incase there is a string variable, then after the variable name there will be a dollar sign for ex:- ADDRESS $, name $ etc.
(e) While naming the variable spacing/giving space is prohibited/not allowed.
(f) Keywords or the reserved words can’t be used as the variable names.
(3) What do you understand by Operators? Explain the different types of operators
Ans :- Operators are the symbols which helps the user in indemnifying/recognizing what form of operation/action QBASIC is going to perform on the data or the values of the variables. Operators are always used in between two or more operands. For ex:- 3
– 2 Here 3 and 2 are called as operands whereas – sign is known as operator. There are four types of operators which in Q BASIC those are:-
(a) Arithmetic Operators :- This operators are used for doing mathematical calculations/ operations like addition, subtraction, division, multiplication exponential etc. The different types of operators which are used while performing Arithmetic operations in QBASIC which are :-
Operator |
Operation | Example | Result |
+ | Addition | 3 + 7 |
10 |
– |
Subtraction | 4 – 2 | 2 |
* | Multiplication | 8 * 4 |
32 |
/ |
Division | 6 / 2 | 3 |
\ | Integer Division | 9 / 2 |
4 |
^ |
Exponential | 4 ^ 3 |
64 |
(b) Relational Operators:- With the help of this operators, the operations of comparison between two values are done. After doing comparison, the result may be true (non-zero) and false (zero). Below is the table, that shows the different types of operation which are used for performing relational operations in Q BASIC :-
Operator |
Operation | Example |
= | Equal to |
A = B |
> |
Greater Than | B > A |
< | Less than |
A < B |
>= |
Greater than or
equal to |
A >= B |
<= | Less than or equal to |
A <=B |
<> |
Not equal to |
A <> B |
(c) Logical Operators:- This operators are used to make a combination between two or more relational expressions. Calculations can be done to return to the specific/single value. The single values can be true or false. And, or, Not are the examples of logical operators. For ex:- the value of A>50 and B>150 is True which means A is more than 50 at the same time B is more than 150.
- AND Operator:- When the both expressions are True , then the result of AND operator will be True otherwise False.
- OR Operator:- When the both expressions are False, the result of OR Operator will be False otherwise True
- NOT Operator:- If the expression False, then the result of NOT operator will be True and vice-versa.
(d) String Operator:- This operator is much helpful in joining two or more data strings together. To represent the String operator plus sign (+) is used. Concatenation is the act/process of joining two strings. Following is the table which shows the example of String Operator :-
|
Concatenation | |
String value (A$) | String Value (B$) |
A$ + B$ |
“Computer” |
“Science” | Computer Science |
“256” | “20” |
25620 |
“World” |
“Peace” | World Peace |
“Cyber” | “Safety” |
Cyber Safety |
“James Bond” |
“007” |
James Bond 007 |
(4) What do you know about Flow of control in a Program
Ans:- Flow of control means it is the sequence of actions which are been performed in a program. All the programs cannot be solved by only writing them in proper sequence, but there are some programs which involves in selecting between two or more possible actions. There are various control flow statements which helps the programmer in changing the CPU path with the help of program. QBASIC supports various control flow statements which are as follows:-
- IF- THEN (Selected)
- IF-THEN ELSE (Branching)
- GOTO (Unconditional Jump)
(a) IF-THEN Statement :- From straight Line to Selection
(b) IF-THEN ELSE statement (Branching Statement) :- Depending upon the conditions in the program, this statement helps the programmer to choose any from the two possible actions.
(C) IF-THEN-ELSEIF-ELSE-ENDIF :- Depending on the conditions, this statement helps the programmer to choose one from two or more actions . FALSE
For further update follow net explanations home page