Notes on Elements of QBASIC programming | Grade 8 > Computer > Computer Programming in QBASIC | KULLABS.COM

Notes, Exercises, Videos, Tests and Things to Remember on Elements of QBASIC programming

Please scroll down to get to the study materials.

• Note
• Things to remember
• Videos
• Exercise
• Quiz To construct the QBASIC program, we have to arrange some standard elements.The elements used in Qbasic are as follows:

• Character set
• Variables
• Constants
• Operator and Operands
• Expression
• Statements

#### Character Set

QBASIC has the character set consisting of the following elements:

1. Alphabets: A, B, C,....Z
2. Digits: 0, 1, 2........,9 and

#### Expression

An expression can be a string, or numeric constant, a variable or a combination of constants, variables with operators which returns a single value.

#### Operands

Operands are the data or variables on which mathematical, logical and string operations take place.

#### Operators

Operators are the symbols, which are used in arithmetic operations, logical expressions, and string expressions.

#### Statements

A statement is a set of instructions written using keywords or commands of QBASIC. Every programming language uses keywords as a statement with certain syntax.

• To construct the QBASIC program, we have to arrange some standard elements.
• A quantity in a computer program which does not change its value during the execution of the program is called a constant.
• The quantity which may change its values during the execution of the program is called a variable.
• A numeric variable can assume numeric value and is represented by an alphabet or an alphabet followed by another alphabet or digit.
.

#### Click on the questions below to reveal the answers

A quantity in a computer program which does not change its value during the execution of the program is called a constant and the quantity which may change its values during the execution of the program is called variable. QBASIC allows the following constants:

• Numeric constant
• String constant

Numeric constant is one that is formed by a sequence of digits 0, 1, 2,.....9 and may include a decimal point. A numeric constant known as number may be integer or a real number. 383, +57, 0, -6.2 and 6.15E4 are valid numeric constants. The number 6.15E4, in fact represent 6.15 * 104. The notation E is used to represent exponential form. The number after E is the exponent which can be positive or negative. However, its length cannot exceed two digits.

In QBASIC, variables are also of two types:

• Numeric variable
• String variable

Numeric variable

Numeric variable can assume numeric value and is represented by an alphabet or an alphabet followed by another alphabet or digit. For example A, C, A2, ABC, A6 etc. represent numeric variables. A string variable is represented by an alphabet followed by dollar ($) sign. It should be kept in mind that while constructing the string variable, dollar ($) should be the last character. For example: B1$, NAME$, BOOK1$, etc are valid string variables. The elements used in Qbasic are as follows: • Character set • Variables • Constants • Operator and Operands • Expression • Statements A statement is a set of instructions written using keywords or commands of QBASIC. Operators are the symbols, which are used in arithmetic operations, logical expressions and string expressions. Operands are the data or variables on which mathematical, logical and string operations take place. 0% • ### The symbol ^ (caret) is used to denote ___________. exponentiation operator multiplication usual meanings division • ### A quantity in a computer program which does not change its value during the execution of the program is called a ___________. constants variables commands operation • ### Which of the following consists of a sequence of characters which must be enclosed by a quotation mark? Exponential Operators Variables String Constant Numeric Constants • ### Which of the following is is represented by an alphabet followed by dollar ($) sign ?

String constants

Numeric constants

String variable

Numeric variable

Operators

Expression

Code

Commands

Expression

Code

Statements

Commands

Operands

Operators

Commands

Code

• ### NAME\$ is an example of:

Numeric variable

String constants

String variable

Numeric constants

## ASK ANY QUESTION ON Elements of QBASIC programming

No discussion on this note yet. Be first to comment on this note