QBASIC Programming

 Programming Language :- 

A programming language is a computer language. The programmers use to develop applications,scripts or other sets of instructions for a computer to execute.

Need of programming language :- 

We need programming language because the computer can not directly understand the problem solving steps or instructions shown in the flowchart or written in the form of an algorithm. These instructions must first be rewritten in a programming language so that the computer can easily understand them.

Types of Programming Language :-

There are two major types of programming language.

  1. Low level language

  2. High level language

Low level language :-

The term low level means closeness to the way in which the machine has been built. Low level language are machine oriented and require extensive knowledge of computer h/w & its configuration. Low level language are further divided into machine language and assembly language.

Machine language :-

Machine language is a collection of binary digit or bits (0s & 1s) that the computer reads and interprets. Machine language is the only language which a computer can understand. A program written in the machine language is called a machine code. Machine language is considered to be first generation language.

Assembly Language :-

The set of symbols and letters forms the assembly language and a translator program is required to translate the assembly language to machine language. This translator program is called assembler. It is considered to be a second generation language.

High Level Language:-

A high level language is an advanced computer programming language that enables a programmers to write programs that is more or less independent of a particular type of computer. There are different high level language such as FORTRAN, BASIC, COBOL, PASCAL, C++, Visual Basic, VB.net etc.

Language Translator:-

The computer understand the instruction written only in machine language. Programs written in all other languages need to be first converted in to the machine code so that the computer can execute them. The language translator is a s/w which translates programs in the assembly language or high level language in to the machine code.

The language s/w can be classified in to three board categories:-

  1. Assemblers :- Assemblers are software programs. Which translates the assembly language programs to machine languages.

  2. Interpreters:- Interpreters also translate the high level language into machine code.

  3. Compliers:- Compliers are also a software program like the assemblers but more complex one. This translates the high level language programs to machine instructions. They can only translate the high level language.


What is BASIC?

BASIC stands for Beginner’s all purpose symbolic instruction code.

It was developed by prof. John G kermeny & Prof. Thomas E Kurtz of Dartmouth college, USA in 1964. 


What is QBASIC?

QBASIC is a structural programming language. It is an integrated development environment (IDE)

In the late 1980 Microsoft made power full version of basic named QBASIC.

It is used in the MS-DOS operating system.

QBasic uses English like words & mathematical symbols to write programs.

The extension of QBasic program file is “.bas”.


Advantage:-

a.) QBasic is the most suitable language for the children or begginers in programming.

b.) it is an easy programming language.

c.) Freely download over the internet.

d.) This programming language is very simple and easy to learn.

e.) Syntax of your code is checked automatically.

f.) it is easier to develop & also easily portable across application.

g.) QBASIC is a high level language that allows us to write programs.

h.) QBASIC has its own program.


Variable:-

Variable are the names given to the memory location where the actual value are stored.

It continuous to hold the value untill another value is assigned to it.

There are two types of variable

a.) Numeric Variable :- A numeric variable store numeric data. A numeric variable can be integer, long integer, & single precision or double precision variables.

b.) String Variable :- A string variable stores string data. It type declaration sign is dollar ($).


Constant :- 

Constanta are the data or the values in a program that can not 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 that one statement or expression.


Constant are two types :-


a.) Numeric Constant:- Any numeric value, either an integer or a real number, positive or negative is called a numeric constant.

Ev.x- -2, 5, 0, -5.5, 9.6 etc.


b.) String Constant :- 

A set of character is called a string.

An alphanumeric or string constant consists of a sequence of character, certain special symbols enclosed in double quotes.


String constant are used to represent non- numeric quantities such as named, address etc.


Character set :- 


A character set consists of those characters which are used to write a program in QBasic.

The character set includes-

Alphabet (A to Z) or (a to z)

Numbers - ( 0 to 9).

Special Character - @, #, $, %, ^, &, *, (, ), /, ?, +, -, _, etc


Operator:-

Operators are symbols that indicate the type of operation QBasic has to perform on the data or on the values of variables. 


There are four types of operators in QBasic.


  1. Arithmatic operators :- They are used to perform mathematical calculations like Addition, subtraction, division, multiplication & exponential.


  1. Relational operators :- They are used to perform comparison on two values of same type.


  1. Logical operations :- They are used to combine two or more relational expressions to evaluate a single value as true (non-zero) or false (zero).


  1. String Operators :- They are used to join two or more than two string data. The plus sign (+) is used as the string Operators. 


Menu Bar:-

Menu bar contains a number of options for performing the various operations related to creating, editing, viewing, executing & debugging. The program you write in the QBasic editor various menu in the menu bar are :-




File Menu:-  It contains options which help you to create, save, open & print files.


Edit Menu :- It contains options like cut, copy & paste to help you to edit the contents of file.


View menu:- It contains options that help you to find a particular word in a program file & change it with another word.


Search Menu:- It contains options that help you to find a particular word.


Run Menu :- It contains options that allows you to run or execute program

.

Debug Menu :- It has options that allow you to remove errors from a program.


Options Menu :- It allows you to change the display settings of the editor windows.


Help Menu :- It allows you to obtain help on any particular topics of QBasic.


Program Title :- It is the name of the program that is currently being displayed in the program area.


Status Bar :- It is located at the bottom of the editors screen. It displays same important keyboard shortcuts to help you quickly open some important menu options whole writing in program.


Immediate Mode Area:- It is located below the program area. It is used to type & execute one line QBasic commands and see their output.


Flowchart:-

Flowchart is a pictorial representation of any program or algorithm.

It uses process of different shapes or symbols to denote different type of instruction.


Algorithm:- It is a step by step description of a problem to solve in program.


Program:- It is a set of instruction.


Programming:- The process of develops the program is called programming.


Q.1 WAP two numbers then calculate sum of both number?

Ans:-

                       

   Q.2 WAP three numbers then calculate sum of all number?

Ans:-     



Q.3 WAP hight a person in the form of feet then calculate height in inch ?

Ans:




No comments:

Post a Comment