QBASIC
Ch-6 First step in programming
Program:- it is a set of instructions.
Programming language:- A language which is used to making
a program is known as a programming language.
► C++, c, java, python...etc are the example of
programming language.
QBASIC:- it is the programming language which is used to
develop a small program.
► BASIC stands
for beginners all-purpose symbolic instruction code.
► It was
developed by professor Jhon G. Kemeny and Thomas E. Kurtz of Dartmouth college
in USA.
► This is for
beginners and was implemented in the 1960’s.
Elements of
programming language
Character set:- it is a set of symbols that consists of
digits , letters and special characters. Where digit is zero(0) to nine(9) ,
letters is A to Z and special character is +,-,/,%,< ,>,=,() , ;
,:,!,$,#,?.
Constants :- the value does not change during program
execution is known as constants.
There are two categories of constant such as-
1.
Numeric constant
2.
String constant
1.
Numeric constant :- A constant on which mathematical
operations such as addition, subtraction, division, multiplication , etc can be
take place is known as numeric constant.
Ø It consists
of digits (positive and negative number) .
Ø It can be of
two types such as :-
¦ Integer type-
1,234, 456,.......etc.
¦ Real number
type – 7.8, 0.765....etc.
2.
String constant :- A constant , on which mathematical
calculation cannot be done is said as string constant
Ø It consists
of digits , letters or other characters.
Ø It is also known
as alphanumeric or non-numeric constants.
Ø These are
always enclosed within double quotes.
Ø In BASIC
programming language, the value of string may be up to 255 characters long.
Ø Examples – “vikasmishra”
, “vmsmproramming”, “1234”
Variable :- A value which can be change during program
execution is known as variable.
► Variable is a
location in the computer memory and within program that can be referred by a
name and whose values can be change during program execution.
► There are two
categories of variable such as-
1.
Numeric variables
2.
String variables
1.
Numeric variables :- A variable which stores a numeric
value is known as numeric variable.
¦ It is the
memory location that stores numbers.
¦ Example -
vmsm=20 where vmsm is a name of variable and equal sign(=) is an
assignment operator and 20 is numeric value .
¦ The name of
numeric variable should not contain any special character and there should not
be any space between two characters.
¦ The maximum
number of characters in a numeric variable is 1 to 8 characters.
¦ The first
character of variable should be letter.
¦ It may
consists both letters or numbers.
String variables :- The memory location or variable that
stores letters or words is called as String variable.
► The name of
string variable always ends with a dollar ($) sign.
► Example-
name$=”vmsm”.
► String is
used to store alphabets , words, specials characters or theirs combinations.
This comment has been removed by the author.
ReplyDeleteSuper
ReplyDelete