Monday, April 7, 2025

7.1 Introduction to Programming Language | Grade 9 New Curriculum Computer Science |

 




7.1 Introduction to Programming Language

7.2 Types of programming languages 

 7.3 Programming tools: flowchart and algorithm 

 7.4 Introduction to coding, testing, and debugging 

 7.5 Compiler and interpreter

 Programming Language

A programming language is a language consisting of a set of instructions provided by the user that tells a computer what task to do and how to do it.

We use a programming language to communicate with computers and tell them what to do. It helps us create apps, games, websites, and much more.

Python, Java, PHP, C++, etc. are some examples of popular programming languages.

 

Programming

It is the process of providing detailed instructions to a computer step by step to do specific tasks.

 

Programmer

A programmer is a person who is involved in writing computer programs.

 

Syntax

The rule for writing commands is called syntax.

7.2 Types of programming languages

·       High-level programming language

·       Low-level programming language

 

High-level programming language

·       A high-level programming language is a type of programming language that is easy for humans to read, write, and understand.

·        It uses English-like words and symbols to create computer programs and needs to be translated into machine language using a compiler or interpreter.

·       Programs written in high-level languages are called program code, and they’re readable to humans but not to computers.

·       Examples: Python, Java, C++, PHP etc.

Low-level programming language

·       Low level programming language is a type of programming language which consist of 0s and 1s and directly understood by computers.

·       Programs are written in the form of machine code, which is difficult for humans to understand without specialized knowledge.

·       Machine language and Assembly language are the types of low level programming language.

·       Machine language is a type of low level programming language which consists of binary code (0s and 1s) that the computer's CPU understands directly. Example: 10101100 01011101

·       Assembly Language is a human-readable form of machine language which uses symbolic codes or mnemonics (e.g., MOV, ADD, SUB) instead of binary.

·       Requires an assembler to convert the assembly code into machine code. Example: MOV AX, 5 ; ADD AX, 3

High level language Vs Low level language

Low-Level Language

High-Level Language

Close to computer hardware (machine)

Close to human language (English-like)

Hard to understand and write

Easy to read, write, and learn

Very fast and powerful

Slower but more user-friendly

Example: Machine code, Assembly language

Example: Python, Java, JavaScript

 

High-level languages are better for beginners because:

  • They are easy to read and write
  • Use English-like words
  • Require less time to learn
  • Help beginners focus on solving problems instead of writing complex code

 

 

7.3 Programming tools: Flowchart and Algorithm

 

Algorithm

An algorithm is a set of step-by-step instructions designed to solve a specific problem or perform a particular task.

It begins with “start” and ends with “stop.”

The instructions are written in simple, general language (like spoken languages).

 

Flowchart

A flowchart is defined as the pictorial and graphical representation of an algorithm.

It uses shapes like rectangles, diamonds, and arrows to show the steps in the process.

The shapes have distinct meanings in a flowchart

 


The table below shows shapes used in flowchart and their meaning:

 




 

We use flowcharts in programming because:

  • They help us visualize the process before writing code.
  • They make it easier to understand how the program works.
  • They help in debugging by showing where things might go wrong.
  • They make complex processes simpler to follow.

 

7.4 Coding, testing and debugging

 

Coding

Coding is the process of writing instructions in a programming language to create software or applications. These instructions, known as code, tell the computer exactly what tasks to perform.

 

Testing

Testing is the process of running program to make sure it works correctly.

Once the code is written, testing is conducted to ensure the program functions as expected.

This involves running the program to identify any errors or bugs and verifying that all parts of the program work correctly.

 

The purpose of testing a program is to make sure that the program works correctly and produces the expected results. Testing helps us identify errors or bugs in the code before it is used in real-world situations.

 

Debugging

Debugging is the process of finding and fixing mistakes (called bugs) in the code.

If testing reveals any errors or bugs, the process of debugging begins.

Bugs can occur because of simple mistakes like missing a comma, using the wrong variable, or logical errors.

 

Debugging is important because:

  • It helps ensure that the program runs correctly.
  • It allows us to find and fix errors that can cause the program to fail.
  • It makes the program more reliable and stable.
  • Without debugging, programs might give incorrect results or crash, which can be frustrating for users.

 

7.5 Compiler and Interpreter

 

Compiler

A compiler is a translator of computer programs that translate the entire high-level language into machine level programming language in a single operation on a computer.

Examples:  JAVA, C#, C, C++, FORTRAN, etc.

 

Interpreter

Interpreter is a translator of computer programs that translate high-level language into machine level programming language one instruction (line of code) and then moves on to the other line.

Examples: Python, Ruby, Qbasic, JavaScript etc.

 


An Assembler is a special tool that translates programs written in Assembly language into machine code, which the computer can understand

No comments:

Post a Comment