The website has the complete lesson note for all the subjects in secondary school but this piece showcases the JSS2 Computer Studies Lesson Note on Simple BASIC Statements. You can use the website search button to filter out the subject of interest to you.
CLICK HERE to download the complete Document: DOWNLOAD HERE
Sub-Topic 4: Simple BASIC Statements
Structure of BASIC program
Example 1: Write a BASIC program to find the average of three numbers.
Solution:
5 REM FIND AVERAGE
10 READ A, B, C
20 DATA 5, 10, 15
25 LET SUM=A+B+C
30 LET AVE=SUM/3
35 PRINT AVE
40 END
Example 2: Write a BASIC program to calculate the volume of a box.
Solution:
10 REM FIND THE VOLUME OF A BOX
20 READ L, B, H
30 DATA 3,5,10
40 LET VOLUME =L*B*H
50 PRINT VOLUME
60 END
Conditional Statements
These are statements in BASIC programming that are dependent on some certain conditions and criteria before they can be obeyed. Example is IF…THEN…ELSE
IF…THEN…
This is a conditional statement. If the condition is true, the statement following the “THEN” is executed.
Example
2 INPUT A
IF A > 500 THEN GOTO 50 ELSE GOTO 2
50 PRINT A
60 END
Sample program
10 REM PROGRAM TO PRINT NAME AND ADDRESS
20 LET A$=”Deeper Life High School”
30 LET B$=”Opete off DSC Express Way, Warri, Delta State”
40 PRINT A$
50 PRINT B$
60 END
Click on the Downloadable Button to get the FULL NOTE
Veterinary medicine is the branch of medicine that deals with the prevention, diagnosis, and treatment…
Anthropology is the scientific study of human beings and their cultures. It encompasses a wide…
Sociology is the scientific study of human society, culture, and behavior. It examines the social…
Social Work is a profession dedicated to helping individuals, families, and communities to cope with…
Religious studies is an academic discipline that explores the beliefs, practices, and history of various…
Public administration is the field of study and practice that focuses on the organization and…