0% found this document useful (0 votes)
59 views6 pages

Ict Test Preparation

The document discusses high level and low level programming languages, language translators like compilers and interpreters, and differences between algorithms and programs. High level languages are easier for humans to read and write but less memory efficient, while low level languages are harder for humans but more memory efficient. Compilers translate whole programs at once while interpreters translate line by line. Algorithms are sets of steps to solve problems, while programs are the specific code implemented in a language. Algorithms are key to AI and machine learning by allowing systems to learn from data and make decisions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views6 pages

Ict Test Preparation

The document discusses high level and low level programming languages, language translators like compilers and interpreters, and differences between algorithms and programs. High level languages are easier for humans to read and write but less memory efficient, while low level languages are harder for humans but more memory efficient. Compilers translate whole programs at once while interpreters translate line by line. Algorithms are sets of steps to solve problems, while programs are the specific code implemented in a language. Algorithms are key to AI and machine learning by allowing systems to learn from data and make decisions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ICT TEST PREPARATION

HIGH AND LOW LEVEL LANGUAGES:

Differences:

High Level Languages:

1. Easier to read by humans and understood.


2. Saves time as they handle many details for them.
3. It works on many computers and can be runned on them
without major changes
4. High level languages require programmers to know less
technical detail about the computer making coding more
accessible.
5. Debugging is easy.
6. It’s Less memory efficient.
7. Examples: Python, Java, Javascript, Php, Pascal.

Low Level Languages:

1. They are harder to read and understand.


2. They can be only accessed by certain hardware.
3. It isn’t commonly used now-a-days in programming
4. It is more complex to maintain.
5. Debugging is hard.
6. It's memory efficient.
7. Examples: Machine code and Assembly language.
Application in real-life

High Level Language (Python):

1. Web Development
2. Data Analysis

Low Level Language ( Assembly Language)

1. Device Drivers.
2. Embedded Systems.

What are Language Translators?

It helps computers to understand and execute the code written


by humans.

There are 3 types of language translators:-

1. Compiler:

- A compiler turns the whole high level language into


machine code all at once.
- It checks the entire program for mistakes before making
an executable file.
- Once translated it doesn’t need to be repeated again and
again.
- Compiled programs can be runned directly.
- The executable file created can’t be translated again.

2. Interpreter:

- It translates high level code 1 line at a time.


- It stops and tells about the error it finds making it easier
to fix problems,
- The code doesn't turn into a separate program but the
interpreter runs it directly.
- It translated high and low level languages into machine
code.
- Interpreted program cant be runned again and again.
3. Assembler:

- An assembler is for low level languages like assembly


language.
- It changes assembly code into machine code.
- Assemblers are needed for working with hardware at a
basic level.

Programming Errors:

There are 2 types of errors occurred during


programming:-

1. Syntax errors

Definition:
It’s a mistake in the structure or grammar of a computer
program.

- It’s like a grammar mistake in a computer.


- It occurs when you write a code that does not follow the
rules of the programming language.
- It’s like using wrong words or not using proper
punctuation in a sentence which causes this to occur

2. Logical errors

Definition:
It means that a program doesn’t do what you want it to do even
if the code is written correctly.

- It’s an error that occurs when a program doesn't do what


you wanted it to.
- The code is written correctly according to the rules but the
results aren’t right.

Programs, Algorithms and Flowcharts

What are Algorithms and its purpose?

Algorithms are like sets of step-by-step instructions that help


computers and people solve problems or do tasks in a
structured and efficient way.
There purpose is to provide :-

1. Efficiency
2. Accuracy
3. Automation
4. Innovation
5. Security
6. Problem Solving
7. Decision Support
8. Understanding Complex Systems
9. Resource Optimization
They are used in many areas like:-

1. Automation
2. Problem Solving
3. Decision Making
4. Data Processing
5. Optimization
6. AI
7. Encryption
8. Simulation
9. Graphic and Image Processing

Differences between an algorithm and a program:

Algorithm:

1. An algorithm is a list of steps to solve a given problem.


2. An algorithm is written using plain natural language
English phrases.
3. Algorithms are easy to write and understand.
4. Algorithms are written in informal language.
5. An algorithm is a generalized solution to a problem that a
computer can solve

Program:

1. Programs are the actual computer code that follows the


plan in an algorithm. (Like cooking following an recipe)
2. They are more detailed and specific.
3. They do the actual work unlike algorithms who just tell
what to do.
4. Programs are written in a particular computer language.

What's the Role of Algorithms in AI?

It allows AI systems to learn data and make decisions based on


it. Algorithms in AI help it understand and generate human
language like chatbots e.g. ChatGPT. It also allows it to make
decisions based on past historical data and allows it to learn
from itself. It’s also used in security like e.g. your phone uses
image recognition and pattern recognition. They are also used
in robotics to help them navigate environments, manipulate
objects and perform tasks. It also allows self learning.

# Get the length of one side of the square from the user

side_length = float(input("Enter the length of one side of the


square: "))

# Calculate the area of the square

(side_length * side_length)
area = side_length * side_length

# Display the result


print(f"The area of the square with side length {side_length} is
{area}.")

Or

a= 2
b= 3
c= a*b
print(c)

You might also like