The content is just an excerpt from the complete note for SS3 Second Term Computer Studies Lesson Note – BASIC Programming II (One-dimensional array). Check below to download the complete DOCUMENT
WEEK 4
TOPIC: BASIC Programming III (One-dimensional array)
CONTENTS
Write BASIC program to:
(a) State data in a vector of 10 integers with and without a FOR_NEXT statement etc
(b) Calculate the average of a one-dimensional array with 100 numeric value
(c) Calculate the area of 10 different rectangles with and without the WHILE_END statement
(d) Output the sum of the first 100 integers
(e) Output the value elements of a given array.
Sub-topic 1
DIM A(10)
FOR 1 = 1 TO 10
READ A (1) // OR INPUT A (1) in an interactive session, i.e. through keyboard
PRINT A(1) // The PRINT statement output data/value of A(I) on the screen
NEXT I
DATA 80, 60, -10, 11, 100, 8, 99, 67, 9, 14 //DATA statement not required if INPUT
END // Statement is used
Calculate the average of a one-dimensional array with 100 numeric values.
REM using WHILE…END
DIM value(100)
Count = 1
Total = 0
WHILE count < 101
Total = total + valu(count)
Count = count + 1
PRINT “total =”, total
PRINT Average=”, total/100
END
To gain full access to the note: DOWNLOAD FILE
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…