Week 4
Week 4
BASIC Programming II
Math functions: BASIC supports various math functions such as ABS, SQR,
EXP, LOG, INT, and RND, which perform operations such as finding the
absolute value of a number, calculating the square root, exponential,
logarithm, integer part, and random number respectively.
Input and Output functions: BASIC has built-in functions to handle input and
output operations. PRINT, INPUT, and LINE INPUT are commonly used
input/output functions.
Date and Time functions: BASIC has several built-in functions to handle date
and time. DATE$, TIME$, TIMER, and DATE$() are examples of date and
time functions.
Graphics functions: Graphics functions allow you to draw shapes, lines, and
other graphical elements. BASIC supports graphics functions such as
CIRCLE, LINE, PSET, and PRESET.
File Handling functions: File handling functions are used to perform operations
on files. BASIC supports functions such as OPEN, CLOSE, and PRINT# for
handling files.
BASIC (Beginner's All-purpose Symbolic Instruction Code) programming
language uses several notations that are important to understand in order to
write and read BASIC code. Here are some of the important notations used in
BASIC:
Variables: In BASIC, variables are used to store values that can be used later
in the program. Variables are named using letters, and can be assigned a
value using the "=" operator.
Control structures: Control structures are used to control the flow of the
program. BASIC supports control structures such as IF-THEN, FOR-NEXT,
WHILE-WEND, and DO-LOOP. These structures are used to execute specific
code blocks based on certain conditions.