KnowledgeBoat Logo
OPEN IN APP

Chapter 9 - Unit 1

Fundamentals of QBASIC: Introduction

Class 6 - APC Understanding Computer Studies



Choose the correct option

Question 1

QBASIC is a programming language. What does the letter Q signify in QBASIC?

  1. Quack
  2. Quick
  3. Quest
  4. Quiet

Answer

Quick

Reason — The full form of BASIC is Quick Beginner's All­ purpose Symbolic Instruction Code.

Question 2

Who among the following are the developer(s) of QBASIC?

  1. Bill Gates
  2. John Kemeny
  3. Bill Gates and Paul Allen
  4. Thomas Kurtz

Answer

Bill Gates and Paul Allen

Reason — In the year 1975, Bill Gates and Paul Allen developed QBASIC.

Question 3

Which of the following is the correct statement about QBASIC?

  1. It is a machine language
  2. It is an assembly language
  3. It is a high-fi language
  4. It is a high-level language

Answer

It is a high-level language

Reason — QBASIC is a compiler-based high-level language where tasks are performed in the windows environment.

Question 4

Which of the following is a correct expression in BASIC?

  1. A B + C D
  2. A x B + C x D
  3. A * B + C x D
  4. A * B + C * D

Answer

A * B + C * D

Reason — This expression uses the operators of QBASIC correctly.

Question 5

Which of the following is not a special character in BASIC?

  1. $
  2. @
  3. <
  4. #

Answer

@

Reason — @ is not used as a special character in BASIC.

Objective

Question 2

Write down the symbols of the special characters.

NameSymbol
hash
forward slash
asterisk
colon
semi-colon
dollar sign
double quotes
exclamation

Answer

NameSymbol
hash#
forward slash/
asterisk*
colon:
semi-colon;
dollar sign$
double quotes"
exclamation!

Question 3

Complete the table with reference to arithmetical operators as shown below:

OperationOperandFormat used
in QBASIC
Multiplication...............M * N
Addition+...............
..............................M / N
...............^...............
Subtraction...............M - N

Answer

OperationOperandFormat used
in QBASIC
Multiplication*M * N
Addition+M + N
Division/M / N
Exponent^M ^ N
Subtraction-M - N

Question 4

Write down the names of the following relational operators:

Relational
Operator
Meaning
> 
<= 
= 
<> 
< 
>= 

Answer

Relational
Operator
Meaning
>Greater than
<=Less than or equal to
=Equal to
<>Not equal to
<Less than
>=Greater than or equal to

Question 5

Name the three types of logical operators and also mention how they are used in QBASIC.

Answer

Logical OperatorsFormat used in QBASIC
AND(A = B) AND (B = C)
OR(A = B) OR (B = C)
NOTNOT(A = B)

Question 6

Convert the following mathematical expressions into QBASIC expressions.

Mathematical
Expressions
QBASIC
Expressions
4 x 5 + 15
a + bc
(ab + cd)/2
pqr
a2 + b3 + c4

Answer

Mathematical
Expressions
QBASIC
Expressions
4 x 5 + 154 * 5 + 15
a + bca + b * c
(ab + cd)/2(a * b + c * d) / 2
pqrp * q * r
a2 + b3 + c4a ^ 2 + b ^ 3 + c ^ 4

Question 7

Write the given instructions in QBASIC:

  1. The product of p, q and r is divided by 100.
  2. m raised to the power 2 plus n raised to the power 3.
  3. The sum of a and b is divided by the product of a and b.
  4. Subtract 5 from m and the result is multiplied by 10.
  5. The sum of p and q is multiplied by 2.
  6. A is greater than or equal to B.
  7. The sum of A and B is less than the product of A and B.
  8. Twice the product of A plus thrice the product of B is greater than or equal to 50.

Answer

  1. (p * q * r) / 100
  2. m ^ 2 + n ^ 3
  3. (a + b) / (a * b)
  4. (m - 5) * 10
  5. (p + q) * 2
  6. A >= B
  7. (A + B) < (A * B)
  8. (2 * a + 3 * b) >= 50

Answer the following questions

Question 1

What is meant by the language QBASIC?

Answer

QBASIC is a programming language developed by Bill Gates and Paul Allen. It is intended to replace GWBASIC programming language.

This language is best suited for beginners. It is user friendly as all types of tasks like general programs, graphics, etc. can be performed using this language. It supports all the commands and instructions of GWBASIC.

It is a compiler based high-level language where tasks are performed in the Windows environment.

Question 2

What are the features of QBASIC language?

Answer

The features of QBASIC language are as follows:

  1. It is user-friendly.
  2. The syntax of the statements is very simple.
  3. It provides Windows-based platform for writing programs.
  4. It is a compiler based language.
  5. Debugging can be easily done.
  6. It doesn't require specifying line numbers.
  7. It provides the facility to find errors in a program.
  8. It works with numeric as well as non-numeric data.
  9. It is useful for mathematical, scientific and engineering purposes as well.
  10. It is one of the simplest high-level languages for beginners.

Question 3

What is meant by character sets? Name the different types of character sets.

Answer

A character set defines the valid characters that can be used in source programs or interpreted when a program is running.

In a computer, three types of character sets are used for entering the data items. They are:

  1. Alphabets
  2. Numbers
  3. Special Characters

Question 4

What is an operator? Name the different types of operators.

Answer

Operators are the symbols that are used in a programming language to perform different arithmetical or logical operations. An operator acts on different data items called operands.

The three types of operators are:

  1. Arithmetical Operators
  2. Relational Operators
  3. Logical Operators

Question 5

Define the following with two examples of each:

(a) Arithmetical Operator

(b) Relational Operator

(c) Logical Operator

Answer

(a) Arithmetical Operator

Arithmetical operators are used to perform mathematical calculations in a program. These operators work in the same sequence in which they are used in mathematics.

For example- addition (A + B), subtraction (A - B).

(b) Relational Operator

A relational operator is used to determine the relationship between two or more operands. The relational operator checks the condition and returns the result in either 'true' or 'false' for further processing.

For example- less than (A < B), greater than (A > B).

(c) Logical Operator

Logical operators are needed to compare two or more expressions. These operators give result in 'true' or 'false', depending upon the outcome of the logical expressions.

For example:

AND ⇒ ((A = B) AND (B = C))
NOT ⇒ (NOT(A = B))

Question 6

What are the rules to write mathematical operators?

Answer

The rules to write mathematical operators are as follows:

  1. There must be an operator between two operands.
    For example, to multiply A and B, we need to write A * B.
  2. Zero raised to the power of any number is insignificant.
    For example, 0 ^ 4.
  3. Division by zero is an invalid statement.
    For example, 8 / 0.
PrevNext