Categories: Lesson Notes

SS3 Second Term Computer Studies Lesson Note – BASIC Programming II (One-dimensional array)

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

  1. Write a program to put 10 integers into the memory and print them on the screen.

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

Sunday

Share
Published by
Sunday

Recent Posts

ETM 312 Theory Questions: Land Law and the Consequences of Unauthorized Land Transfers in Nigeria

300 Level Estate Management and Valuation Department exam questions and detailed answers. Download the answers…

5 months ago

ETM 312 Theory Questions: Co-Ownership Structures and Land Acquisition Methods in Nigeria

200 Level Estate Management and Valuation Department exam questions and detailed answers. Download the answers…

5 months ago

ETM 312 Theory Questions: Rights in Community Land and Fundamental Land Concepts in Nigeria

200 Level Estate Management and Valuation Department exam questions and detailed answers. Download the answers…

5 months ago

ETM 312 Theory Questions: Customary Land Control and the Origins of Nigeria’s Land Use Act

200 Level Estate Management and Valuation Department exam questions and detailed answers. Download the answers…

5 months ago

ETM 312 Theory Questions: Land Ownership Principles and Transaction Laws in Nigeria

200 Level Estate Management and Valuation Department exam questions and detailed answers. Download the answers…

5 months ago

ETM 226 Theory Questions: Trespass: Types and Defenses in Property Law

200 Level Estate Management and Valuation Department exam questions and detailed answers. Download the answers…

5 months ago