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:

  • Arithmetic Operations In Basic Programs
  • Order of Arithmetic Operations In Basic

1. Multiplication operation in Basic language uses the asterisk (*), for example, Let C = A*B

2. Division operation in Basic uses slash (/)

3. Addition in Basic language uses the plus sign (+)

4. Subtraction in Basic language uses the minus sign (-)

5. Exponentiation operation in Basic uses the up-caret sign (^) to raise the number to a power, for example, Print A^2 * B^2.

Order of Arithmetic Operations In Basic:

1. Parenthesis/Brackets: these are worked out first from the inner-most parenthesis outwards from left to right

2. Exponentiation: this is marked next from left to right

3. Multiplication and Division: this follows from left to right

4. Addition and Subtraction: it is formed in order of addition and subtraction from left to right.

All operations in the first order must be completed before moving to the next order of operation. For example,

PRINT (2+4) ^2+4 *2.

Firstly, we do the parenthesis or bracket; (2+4) = 6

Then, exponentiation; 6^2 = 36.

Then multiplication; 4*2 = 8.

Then, finally, addition: 36 + 8 = 44

The computer will display 44

Example 1.2.1:

Evaluate these BASIC statement expressions:

(i) 5*(6+2)^3
(ii) (4/2) + (15/5)*3^3

(i) 5*(6+2)^3

Solution

Firstly, we do the parenthesis or bracket; (6+2) = 8

5*8^3

Then, exponentiation; 8^3 = 512.

Then multiplication; 5*512 = 2560

(ii) (4/2) + (15/5)*3^3

Solution

Firstly, we solve the equation in the bracket or parenthesis 4/2 = 2 and 15/5 = 3

2 + 3* 3^3

Then, exponentiation; 3^3 = 27

2 + 3* 27

Then multiplication; 3*27 = 81

2 + 81

Finally, we add the values that are left

= 83

avataravatar