In: Computer Science
List the arithmetic operators used in BASIC and state their priorities of execution in a statement. Also give a list and briefly explain the functions of the most popular statements.(IN OWN WORDS MIUST BE)
ANSWER:
Arithmetic operations in BASIC are represented by the following
symbols:
+ - ADDITION
− - SUBTRACTION AND NEGATION
* - MULTIPLICATION
/ - DIVISION
** or ↑ - EXPONENTIATION
Exponentiation has the highest priority of execution;
multiplication and division are executed next; addition and
subtraction are done last. If 2 or more equally "powerful"
operators are present in the statement, their execution goes from
left to right.
Operations in parenthesis are always done first.
The most popular BASIC statements are:
LET variable = expression
(The arithmetic assignment statement)
INPUT variable list
(Statement for data entry from terminal into a program during the
execution phase)
READ variable, variable, etc.
(Statement for data entry from the DATA statement)
DATA constant, constant, etc.
(Information supplier statement for READ statement)
PRINT variable, constant, "junk", etc.
(Primary output statement)
REM comments
(Comments, insertion statement)
GO TO n
("Sends" the computer to the statement labelled n)
More complicated statements will be explained in later problems.