Modes of operations in Basic:
Program statements can be entered with or without a line number
depending on the mode of operation. There are two types of program modes
in Basic :
- Direct mode :
In
the direct mode , program statements are entered without any line number
. The computer will execute it as soon as the <Enter> or
<Return> key is pressed . A program is written in the following
picture using this mode
This facility is mostly used in scientific calculators to provide
immediate computation . Here are the examples of some more programs
using print statement in "Direct mode"
Program (1) :
Print 25+39
On pressing enter key the output will be :
Output:
64
_________________________________________________________________________________
Reserved words in Basic
Certain words have special meanings in Basic .
These are known as reserved words .
These words cannot be used as variables .
There are nearly 160 reserved words in GW-Basic including those given following :
ABS,AND,ASC,AUTO,
BEEP,CALL,CHR,CIRCLE,
CLEAR,CLS,CLOSE,
COLOR,COM,COMMON,
CONT,COS,CSNG
DATA,DATE,DEF,
DEL,DELETE,DIM,
EDIT,ELSE,END,
OF,EQUAL,ERASE,
ERR,ERROR,EXP,
FIELD,FILES,FIX,
FOR,FREE,GET,
GOSUB,GOTO,HEX,
IF,INKEY,INPUT,
INT,KEY,KILL,
LET,LINE,LIST,
LLIST,LOAD,LOCATE,
LOG,LPRINT,LSET,
MARGE,MERGE,MOD,
MOTOR,NAME,NEW,
NEXT,NOT,OFF,
ON,OPEN,OPTION,
OR,OUT,PAITN,
PEEK,PSET,PEN
PLAY,POS,PRESET,
PRINT,PUT,XOR,
WHILE,WEND,VAL,
USING,TROFF,TAB,
TIME$,SVS,STRING,
STICK,STEP,SQR,
RENUM,RND,RESET etc
Download your own GW-Basic interpreter from here and start making programs in no time
_______________________________________________________________________________
Basic an Introduction
Introduction:
Basic stands for Beginners All Symbolic Instruction Code . It is the first high level languages to be used on micro-computers .
The original Dartmouth BASIC was designed in 1964 by John George Kemeny
and Thomas Eugene Kurtz at Dartmouth College in New Hampshire, USA to
provide computer access to non-science students. At the time, nearly all
use of computers required writing custom software, which was something
only scientists and mathematicians tended to do.
The language and its variants became widespread on microcomputers in the
late 1970s and 1980s, when it was typically a standard feature, and
often part of the firmware of the machine.
Most popular versions of Basic are :
- GW - Basic
- Q - Basic
Because of its simplicity and conversational nature , Basic quickly
became one of the most popular programming language . It has following
features common in all versions
- It is an easy students friendly language.
- It is a general purpose language suitable for scientific and commercial programming .
- It has a simple syntax rules and is easy to test and debug .
- Communication with computer is simple and straight forward with it
- It is well suited for computers having limited memory .
______________________________________________________________________________
Program preperation in Basic
- Problem identification stage :
- Defining a problem (Knowing the objectives of a problem)
- Analyzing the problem (understanding the problem)
- Planning stage :
- Developing the algorithm (Step by step problem solving)
- Developing or drawing a Flow chart (pictorial view of the algorithm)
- Writing psuedocode (writing the algorithm in simple lanuage )
- Writing the program (converting the algorithm into a computer program using a programming language)
- Testing and debugging the program (testing and removing errors from the program)
- Running the program
- Implementation and documentation stage :
- Implementing the program (taking the program and placing it into operation)
- Documenting the program (Describing the input , output and the way the computer has to be handled)
No comments:
Post a Comment