Programming Language And Basic Language JSS2 Computer Studies Lesson Note
Download Lesson NoteTopic: Programming Language And Basic Language
PROGRAMMING LANGUAGE
A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. The term programming language usually refers to high-level languages, such as
BASIC,
C,
C++ ,
COBOL,
FORTRAN,
Ada, and
Pascal.
Each language has a unique set of keywords (words that it understands) and a special syntax for organizing program instructions.
High-level programming languages, while simple compared to human languages, are more complex than the languages the computer understands, called machine languages.
Each different type of CPU has its unique machine language.
MACHINE LANGUAGE
Programming language that can be directly understood and obeyed by a machine (computer) without conversion (translation). Different for each type of CPU, it is the native binary language (comprised of only two characters: 0 and 1) of the computer and is difficult to read and understand by humans.
LOW-LEVEL LANGUAGE
In computer science, a low-level programming language is a programming language that provides little or no abstraction from a computer’s instruction set architecture commands or functions in the language map closely to processor instructions. Generally, this refers to either machine code or assembly language.
HIGH-LEVEL LANGUAGE
A programming language such as C, FORTRAN, or Pascal enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further
from machine languages.
Questions
- What is a programming language?
- Give examples of a programming Language
ELEMENTS OF QBASIC
INTRODUCTION
Every programming language consists of some basic elements which are required to make a program. The element required to construct a BASIC program consists of a set of characters, keywords, constants, variables, operators, and expressions.
- CHARACTER SET
The BASIC Character Set consists of alphabets (both small and capital), numbers (0 to 9), and special characters. These special characters have their meaning and function.
- KEYWORD
Keywords are those words that have special meanings in BASIC. Keywords are statements or Reserved Words, commands, and names of operators. Some reserved words are CLS, REM, INPUT, LET, PRINT, FOR, DO, SELECT, MID$, ASC, SQR, LEN, LEFT$, TIME$ and INT.
- CONSTANTS
Constants are the data or the values in a program that cannot be changed during the program execution. The data may be a letter, words, numbers, or special characters. Types of constants are
- Sting Constant
- Numeric Constant
- VARIABLE
A variable is an entity that stores data needed to be used in a program. Each program defines a different number of variables.
There are mainly two types of variables. They are:
- String Variable
- Numeric Variable
- OPERATOR
Operators are symbols that indicate the type of operation BASIC has to perform on the data.
There are four types of operators in BASIC. They are Arithmetic Operators, Relational Operators, Logical Operators, and Sting operators.
QBasic’s Math Operators
OBJECTIVES:
- Using QBasic Math Operators
- Use Order of Operation
- Store the results of calculations in variables
- Print the result of the calculations
A Math Operator is a symbol used for addition, subtraction, multiplication, division, or other calculations.
The QBasic math operators and their meanings.
Symbol Meaning
* Multiplication
/ Division
+ Addition
– Subtraction
^ Exponentiation
\ Integer division
MOD Modulus
Example: (95/2=47.5)
Formula Results
8\2 4
95\2 47
95.0\2 47
95\2.0 47
95.0\2.0 47