Back to Course

JSS2: COMPUTER STUDIES - 2ND TERM

0% Complete
0/0 Steps
  1. Introduction To Basic Language I | Week 1
    7 Topics
    |
    1 Quiz
  2. Introduction To Basic Language II | Week 2
    2 Topics
    |
    1 Quiz
  3. Computer Ethics I | Week 3
    6 Topics
    |
    1 Quiz
  4. Computer Ethics II | Week 4
    2 Topics
    |
    1 Quiz
  5. Safety Measures In Computer Environment | Week 5
    3 Topics
    |
    1 Quiz
  6. Computer Graphics Packages I | Week 6
    3 Topics
    |
    1 Quiz
  7. Computer Graphic Packages II | Week 7
    6 Topics
    |
    1 Quiz
  • excellence
  • Follow

Lesson Progress
0% Complete

Topic Content:

  • How To Write A Simple Basic Program

Example 2.2.1:

Write a simple Basic program to calculate the sum of 10, 15, 20 and 25.

Solution

Let A, B, C and D represent the four values. Let SUM = A + B + C + D

10 REM: SUM OF FOUR VALUES

20 CLS

30 LET A = 10

40 LET B = 15

50 LET C = 20

60 LET D = 25

70 LET P = A+B+C+D

80 PRINT P

90 END

Example 2.2.2:

Write a simple Basic program to calculate the perimeter (P) of a rectangular object whose length (L) is 20 meters and width (W) is 5 meters. Formula for perimeter = 2(L+W)

Solution:

10 REM: PERIMETER OF AN OBJECT

20 CLS

30 LET L = 20

40 LET W = 5

50 LET P = 2*(L+W)

60 PRINT P

70 END

Summary:

1. BASIC is meant for beginners as one of the most popular computer languages.

2. The Interpreter is a set of instructions that translates source programs in BASIC to machine codes.

3. Data representation involves the use of alphabets, numbers, strings and some special symbols.

4. There is a special order to be followed in evaluating mathematical problems in BASIC.

5. There are keywords like LET, EDIT, LOAD etc in BASIC language.

6. There are function keys which make the use of BASIC language flexible.

avatar