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

Week 4 Basic Programming II

This document outlines the learning objectives for a BASIC programming lesson, focusing on arithmetic expressions and built-in functions. It includes examples of BASIC notations for algebraic expressions and provides sample programs for calculating square roots and trigonometric functions. Additionally, it contains class activities and assignments related to built-in functions and programming tasks.

Uploaded by

bangjilepdung
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)
16 views2 pages

Week 4 Basic Programming II

This document outlines the learning objectives for a BASIC programming lesson, focusing on arithmetic expressions and built-in functions. It includes examples of BASIC notations for algebraic expressions and provides sample programs for calculating square roots and trigonometric functions. Additionally, it contains class activities and assignments related to built-in functions and programming tasks.

Uploaded by

bangjilepdung
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

WEEK 4 DATE: ..............................

TOPIC: BASIC PROGRAMMING III

Learning Objectives:
At the end of this lesson students should be able to:
 List BASIC Arithmetic Expressions; (i)√b2 -4ac2a (ii) (x-y)/(x+y) (iii) (a+b) + c/Sin d
 State the application of each built-in-functions
 Write BASIC notations of algebraic expression using built-in-functions
 Write simple programs using built-in-functions; (i)find square root of numbers within
a given range

BASIC Notation/Symbols of Algebraic Expressions

(i) b2– 4ac/2a


Solution: SQR B**2 – 4*A*C/2*A OR SQR B^2 – 4*A*C/2*A

(ii) (x-y)/(x+y)
Solution: (x-y)/(x+y)

(iii) (a+b) + c/Sin d


Solution: (iii) (a+b) + c/SIN (d)

(iv) ex+y –Sin (x +ny)


Solution: (e^x+y- SIN(x+n*y))

(v) B = 1/4ac
Solution: B=1/4 (a*c)

(vi) A=∏r²
Solution: Area=PI*r**2 or PI*r^2

S ub-topic 2: BASIC Program to solve problems.


Example 1: Write a BASIC program to find square root of numbers within a given range.

Solution
INPUT “Lower range value....” LRNG
INPUT “UPPER range value...”, URNG
FOR I= LRNG TO URNG
SQR= 1** (1/2) // calculate the square root of the next number
ISQR= INT (SQR) // convert the square root to integer
PRINT “Square root of; ”1; “is “; ISQR
PRINT
NEXT I
END/STOP
Example 2: Write a BASIC program to find the SINE, COSINE and TANGENT of numbers.
FOR J= 1 TO 10
INPUT “Enter the next value/ number”; NUM
S= SIN (NUM)
C= COS (NUM)
T= TAN (NUM)
PRINT “Number “;J; “SINE = “;S; “COSINE =”;C;” TANGENT = “;T
NEXT J
END

Class Activities:
1. State four built-in functions.
2. State the use of the following built-in functions: a. RND (X) b. ABS (X)
3. What is the meaning of these BASIC functions? LOG, TAN, and ABS.
4. Which Mathematical operator has two notations in BASIC?

READING ASSIGNMENT
Read the topic “Internet” and summarize in one and half pages.

WEEKEND ASSIGNMENT
1. Write BASIC notation for:
a. A= (-b-d) divided by 2c
b. Z= x divided by y-c
c. C= 9c divided by 5 plus 32.
2. Write BASIC program to compute the square root of numbers from 10-40.

You might also like