what are the elements on which qbasic operations are carried.
Answers
Explanation:
The element required to construct a QBASIC program consists of a set of characters, keywords, constants, variables, operators and expressions.
- CHARACTER SET
- KEYWORD.
- CONSTANTS.
- VARIABLE.
- OPERATOR
- EXPRESSIONS
1. CHARACTER SET
A set of characters that are allowed to use in QBASIC is known as the QBASIC Character Set. The QBASIC Character Set consists of alphabets (both small and capital), numbers (0 to 9) and special characters. These special characters have their own meaning and function. The table below shows the special characters used in QBASIC.
QBASIC keywords and variables are formed by using the characters defined in the QBASIC Character Set.
2. KEYWORD
Keywords are those words which have special meanings in QBASIC. Keywords are formed by using characters of QBASIC Characters Set. Keywords are statements, commands, functions (built in functions) and names of operators. The keywords are also called Reserved Words. Some reserved words are CLS, REM, INPUT, LET, PRINT, FOR, DO, SELECT, MID$, ASC, SQR, LEN, LEFT$, TIME$ and INT.
3. CONSTANTS
Constants are the data or the values in a program that cannot be changed during the program execution. The data may be a letter, words, numbers, or special characters. A constant can be stored in a variable when it is required to use in more than one statement or expression. In QBASIC, these data/constants are grouped into two main categories. They are:
a. Sting Constant
b. Numeric Constant
a. String Constant:
Sting Constant is a letter, words, numbers, combination of letters with numbers or special characters enclosed in double quotes. Mathematical operations cannot be performed on String Constants.
“B”, “APPLE”, “SYMBOL NO:10205”, “!!! Welcome to QBASIC World !!!”, etc. are some examples of Sting Constants.
b. Numeric Constant:
Numeric Constant refers to a number. A number with or without decimal point is a numeric constant. Thousand separators are not allowed to use in numeric constant. Numeric data should not be enclosed in double quotes. Mathematical operations and logical operations can be performed on the numeric constants.
VARIABLE
A program is written to perform certain tasks. A program needs data to produce information. A program can use data only when data are stored in the computer memory (RAM). In a computer memory, there may be many data. So, you need to tell the computer to use only those data which you want to use in a program. This is possible if you assign a name to the place where you have stored a data. In QBASIC, you can perform this task by using a variable.