Chapter 11 Introduction to QB64
Brain Developers
A. Fill in the blanks:
1. The value which does not change during the execution of a program is called constant.
2. A character set is a set of symbols which are used in a programming language.
3. The hierarchy in which the operators are executed in QBASIC expression is called BEDMAS.
4. Numeric constants contain only numeric values.
5. String constant must be enclosed within double quotes.
B. State True or False:
1. A String variable is represented by an alphabet followed by a dollar ($) sign. (True)
2. Variables are of three types. (False)
Correct Answer: Variables are of two types: Constants and Variables.
3. Constants are memory locations to store data in it. (False)
Correct Answer: A variable is a location in the memory, which has been assigned a name and is used to store data temporarily.
4. Numeric constant include all the positive and negative numbers. (True)
5. The variable name must begin with a number. (False)
Correct Answer: The variable name must begin with an alphabet followed by either alphabet or a digit.
6. X = 1.3 is a valid statement. (True)
7. 22.4, 43.6 are examples of whole numbers. (False)
Correct Answer: 22.4, 43.6 are not the examples of whole numbers.
8. Addition and subtraction operations come first in BASIC hierarchy. (False)
Correct Answer: Brackets and Exponentiation operations come first in BASIC hierarchy.
C. Application Based Questions:
1. Mansi wants to write a program to compare two values which are not equal. Suggest her the operator which displays the non-equality between two operands.
Answer: Mansi can use <> to compare two values which are not equal.
2. Ritika has written a program in QB64. She wants to run the program using the shortcut key. Suggest the shortcut key to run a program.
Answer: Ritika should press F5 function key to run the program. The F5 key compiles the program into .exe file and runs it.
D. Multiple Choice Questions:
1. _______________ sign is added at the end of a String variable.
a) $
b) &
c) %
Answer: a) $
2. Which is the correct numeric expression?
a) A="5*5"
b) A1$=52
c) A2= 21
Answer: c) A2= 21
3. __________________ key is used to compile a program into .exe file and run it in QB64.
a) F5
b) F6
c) F8
Answer: a) F5
4. The extension of QB64 program file is _____________.
a) .qb
b) .qbas
c) .bas
Answer: c) .bas
5. QB64 was developed by ______________________.
a) John G. Kemeny
b) Galleon
c) Thomas E. Kurtz
Answer: b) Galleon
E. Answer the following in one word or in a sentence:
1. What is the full form of BASIC?
Answer: The full form of BASIC is Beginners All Purpose Symbolic Instruction Code.
2. What are the different types of constants?
Answer: There are two types of constants: Numeric Constants and Alphanumeric or String Constants.
3. Give two examples of both numeric and alphanumeric constants.
Answer:
Numeric Constants: 224, -7.4
Alphanumeric Constants: "RAGHAV", "SUM = Rs 84"
4. Which operator is used to represent 'less than or equal to' condition in QB64?
Answer: Relational operator is used to represent 'less than or equal to' condition in QB64.
5. Which statement is used to display the output on the screen?
Answer: PRINT statement is used to display the output on the screen.
6. What are the types of operators in QB64?
Answer: There are three types of operators in QB64: Arithmetic, Relational and Logical.
7. Who developed BASIC language?
Answer: BASIC language was developed by Professor John G. Kemeny and Thomas E. Kurtz.
F. Answer the following:
1. Define QB64 language.
Answer: QB64 is the updated version of QBasic. It is compatible with Windows as well as Linux operating system. It supports files with different formats, and provides Clipboard for reading and writing. users can easily copy or paste codes from any document on to QB64 screen and vice-versa.
2. Write the different ways to run a QB64 program.
Answer: The different ways to run a QB64 program are
→ By pressing F5 key.
→ By selecting Run menu and clicking on Start option.
3. Define variables. Name the types of variables.
Answer: A variable is a location in the memory, which has been assigned a name, and is used to store data temporarily. There are two types of variables: Numeric variable and Alphanumeric or String variables.
4. Differentiate between Numeric and Alphanumeric Constant.
Answer:
• Numeric Constant
→ It consists of any numeric value, either an integer or a real number, positive or negative.
→ These constants are used for calculations, and should not include any special characters.
→ Example: 224, 0, - 7.4
• Alphanumic Constants
→ It is a set of characters. It consists of a sequences of characters (A-Z, a-z, 0-9) and certain symbols (like % ? # ^ & * () ; : " ' / \ etc ) are enclosed in double quotes.
→ String constants are used to represent non-numeric quantities, such as names, addresses etc.
→ Example: "RAGHAV", "SUM=Rs 84", "192"
5. Define the term Hierarchy of operations. Write the hierarchical order of the arithmetic operators in QB64.
Answer: Hierarchy defines the order in which the operators are executed in any QBasic expression. We use BEDMAS for the hierarchy of operations. The full form of BEDMAS is Brackets, Exponentiation, Division, Multiplication, Addition, Subtraction. This means that bracket will be solved, then exponentiation will be performed, now multiplication and division will be performed, now addition and subtraction will be performed.
No comments:
Post a Comment