0% found this document useful (0 votes)
8 views2 pages

Week 4

The document outlines the built-in functions of the BASIC programming language, including math, string, input/output, date and time, graphics, and file handling functions. It also explains important notations in BASIC such as statements, variables, operators, control structures, functions, and comments. Understanding these elements is essential for writing and reading BASIC code.

Uploaded by

ellamoses375
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Week 4

The document outlines the built-in functions of the BASIC programming language, including math, string, input/output, date and time, graphics, and file handling functions. It also explains important notations in BASIC such as statements, variables, operators, control structures, functions, and comments. Understanding these elements is essential for writing and reading BASIC code.

Uploaded by

ellamoses375
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

WEEK 4

BASIC Programming II

BASIC programming language has a variety of built-in functions that are


commonly used to perform a range of tasks. Here are some examples of built-
in functions in BASIC:

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.

String functions: String functions are used to manipulate strings. BASIC


supports string functions like LEFT$, RIGHT$, MID$, LEN, INSTR, UCASE$,
LCASE$, TRIM$, and STR$ that perform operations like extracting a sub-
string from a string, finding the length of a string, converting to upper or lower
case, and trimming white space from a string.

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:

Statements: A BASIC program is composed of a series of statements. Each


statement is a single line of code that performs a specific task or operation.

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.

Operators: BASIC supports various operators such as arithmetic operators (+,


-, *, /), comparison operators (=, <>, <, >, <=, >=), and logical operators (AND,
OR, NOT). Operators are used to perform mathematical and logical
operations on values.

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.

Functions: BASIC supports a variety of built-in functions that perform specific


tasks. Functions are called by their name followed by parentheses, and may
take arguments within the parentheses.

Comments: Comments are used to add notes or explanations to the code. In


BASIC, comments are indicated using the apostrophe ('), and anything after
the apostrophe is ignored by the compiler.

You might also like