Elements of QBASIC programming

To construct the QBASIC program, we have to arrange some standard elements. This note provides an information about elements of QBASIC programming.

Summary

To construct the QBASIC program, we have to arrange some standard elements. This note provides an information about elements of QBASIC programming.

Things to Remember

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

MCQs

No MCQs found.

Subjective Questions

Q1:

Find the words/phrases from the advertisement which have similar meaning:

Salary


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>Remuneration</p>

Q2:

Find the words/phrases from the advertisement which have similar meaning:

Capable


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>qualified</p>

Q3:

Find the words/phrases from the advertisement which have similar meaning:

bio-data


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>CV</p>

Q4:

Find the words/phrases from the advertisement which have similar meaning:

searching


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>looking</p>

Q5:

Find the words/phrases from the advertisement which have similar meaning:

latest


Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <p>recent</p>

Q6:

Find the above advertisement and answer the following questions:

What is the advertisement for?


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>This advertisement is for a dynamic energetic and qualified teacher for the post of Math (full time teacher)</p>

Q7:

Find the above advertisement and answer the following questions:

Write the minimum qualification and experiences for the posts.


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>The minimum qualification for the post is M.A. in Mathematics and the minimum experience for the post is at least 3 years.</p>

Q8:

Find the above advertisement and answer the following questions:

List out the other documents to be sent along with the application.


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>A copy of their academic qualification, CV and recent passport size photograph.</p>

Q9:

Complete the following table with correct information:

The number of required posts                              
Location of the institution  
Salary  
Contact Number  

Type: Very_short Difficulty: Easy

Show/Hide Answer
Answer: <table width="308"><tbody><tr><td>The number of required posts</td> <td> 1 </td> </tr><tr><td>Location of the institution</td> <td>Janakpurdham</td> </tr><tr><td>Salary</td> <td>Negotiable</td> </tr><tr><td>Contact Number</td> <td>20519</td> </tr></tbody></table><p></p>

Videos

No videos found.

Elements of QBASIC programming

Elements of QBASIC programming

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

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

  • Numeric constant

    The 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 may be an 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 the 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 constant consists of a sequence of characters which must be enclosed by a quotation mark.

Variables

The quantity which may change its values during the execution of the program is called the variable.

In QBASIC, variables are also of two types:

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


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.

Lesson

Computer Programming in QBASIC

Subject

Computer

Grade

Grade 8

Recent Notes

No recent notes.

Related Notes

No related notes.