Notes on Starting,Structure, Constants and Variables of QBASIC | Grade 9 > Computer > QBASIC Programming | KULLABS.COM

• Note
• Things to remember
• Videos
• Exercise
• Quiz

QBASIC Programming QBASIC is the most popular high level programming language. Various versions of BASIC have been developed by Microsoft Company. This language is quite simple to understand and has been adopted by most of the microcomputers. It is suitable for both mathematical and business problems. It is compatible with MSDOS environment and it has two basic files QBASIC.EXE and QBASIC.HLP. We can edit, debug and execute the program using these two files.

The advantages of QBASIC

1. QBASIC is easy to learn and fun to practice. It may be called a "People's language".
2. It is available almost in every computer from micro to mainframe. Therefore, a program developed in a micro can run on bigger system with minor modifications.
3. It is suitable for mathematical and business application.
4. Program development cycle is quick, debugging is simple, and
5. Modification of program is quite easy.

Starting QBASIC It occupies very low memory so it may be possible to run the system using floppy disk also. It is compatible with MS-DOS and have only two files QBASIC.EXE and QBASIC.HLP.

Steps

1. Get MS-DOS System and MS-DOS Prompt
C:\>
2. Change the Directory
C:\>CD QBASIC
C:\QBASIC>
3. Type QBASIC and press Enter
C:\QBASIC>QBASIC enter

When you are working with Windows system. Open QBASIC Folder on Windows.

Double click over the QBASIC.EXE icon. We will get the QBASIC System as below. Press ESC key and get the programming window of the QBASIC and type the program on the working of QBASIC.

Structure of Basic

To construct the QBASIC program we have to arrange some standard elements.

The elements are:

1. Character set
2. Variables and constant
3. Arithmetic expressions
4. Relational or Logical expressions
5. Keywords
6. Syntax
7. Library functions

The 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
3. Special characters: + - * / ( ) . , $; ,: ,= ,> ,< , ^ The symbol ^ (caret) is used to denote exponentiation operator, the symbol * (asterisk) is used to denote multiplication and other symbols; have their usual meanings. Constants and Variables 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 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. It is also important to keep in mind that • QBASIC does not distinguish between an integer and fraction. • Commands are not allowed in a numeric constant. • The limit on the number of digits that can be used varies from computer to computer. Normally, a numeric constant can have up to a maximum of eight digits. • String constant A string constantconsists of a sequence of characters which must be enclosed by a quotation mark. In QBASIC, variables are also of two types: 1. 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, A6etc, represent numeric variables. 2. String variable : 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.

• QBASIC is the most popular high level programming language.
• A quantity in a computer program which does not change its value during the execution of the program is called a constant. There are numeric and string constant.
• The quantity which may change its values during the execution of the program is called variable. There are string and numeric variable.
.

Very Short Questions

The advantages of QBASIC are:

1. QBASIC is easy to learn and fun to practice. It may be called a "People's language".
2. It is available almost in every computer from micro to mainframe. Therefore, a program developed in a micro can run on bigger system with minor modifications.
3. It is suitable for mathematical and business application.
4. Program development cycle is quick, debugging is simple, and
5. Modification of program is quite easy.

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 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.

0%
• The CLS statement _______.

all of the answers are correct
used to instruct the user to enter data
to enter data
is used for clearing the screen.
• Which of the following is not the advantages of Qbasic?

It is not suitable for mathematical and business application
Program development cycle is quick, debugging is simple
It is available almost in every computer from micro to mainframe
Modification of program is quite easy.
• The IF__ THEN Statements ______.

is used to eliminates the need for prompting each INPUT statement
is transfer of control
is used to re-direct a statement
is a conditional branch statement
• QBASIC does not distinguish between an ______ .

integer and fraction
numeric constant
string variable
numeric variable
• The LET statement in BASIC ______.

allows the user to enter data into the computer from outside the programme during programme execution
none of the answers are correct
allows us to assign a value to a variable
checks the errors within the code
• A quantity in a computer program which does not change its value during the execution of the program is called ______ .

character set
keywords
variable
constant
• The symbol '^' is used to denote ______.

division
none of the answers are correct
multiplication
exponential

ASK ANY QUESTION ON Starting,Structure, Constants and Variables of QBASIC

Forum Time Replies Report
Computer

What is counter variable?

Binayak

WAP to print the given number is armstrong or not