Question 1 Report
(a) Define programming language.
(b) Write the 5 following mathematical expressions in BASIC notation:
(i) x (w + y)\(^2\) (ii) ab/cd (ii) p = 2 (1+b).
(c) Write a simple BASIC program to calculate the area (A) of a rectangle with length (l) and breath (b).
(d) List two levels of programming language.
(a) Definition of programming language
A programming language is a set of symbols, words and grammatical rules (syntax) used to write instructions that a computer can understand and carry out to solve a problem. Examples are BASIC, C, Java and Python.
(b) The expressions in BASIC notation
X * (W + Y) ^ 2(A * B) / (C * D)P = 2 * (1 + B)(c) BASIC program to calculate the area (A) of a rectangle
The area of a rectangle is length multiplied by breadth, \(A = l \times b\).
10 REM PROGRAM TO FIND AREA OF A RECTANGLE
20 INPUT "ENTER LENGTH"; L
30 INPUT "ENTER BREADTH"; B
40 A = L * B
50 PRINT "AREA OF RECTANGLE = "; A
60 END(d) Two levels of programming language
Everything you need to excel in your exams