Advantages and disadvantages of high-level and low-level languages

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Advantages and disadvantages of high-level and low-level languages

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement about high-level languages is correct?
A They are harder to read because they use only binary
B They are easier to read and write because they use English-like words
2. Which language type is usually easier to debug?
A High-level, because the code is easier to read and understand
B Low-level, because each line is a complex instruction
3. Which language type is machine independent (portable)?
A High-level: the same code can run on different processors once translated
B Low-level: the same code runs on every type of processor
4. Which language gives the programmer direct control of hardware, such as memory and registers?
A Low-level language
B High-level language
5. Which is a disadvantage of a high-level language?
A Hard to read, because it uses mnemonics and registers
B Less control over the hardware, because the translator hides the detail

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1high-level: portable ALow-level languages are machine dependent, so they only work on the processor they were written for. High-level languages are the portable ones.
2low-level: direct hardware control BThe programmer can control memory, registers and other hardware directly, which suits device drivers and embedded systems.
3High-level code is easier to read, write and debug because it uses English-like words and statements. CHigh-level languages give less direct hardware control because they hide the hardware details. Being easy to read does not give more control.
4Low-level code is hard to read and debug because each line is a single machine-level instruction. DLDA 20 ADD 21 STA 22
5Low-level languages are portable because they work on every type of computer. EIF score >= 50 THEN PRINT "Pass"
6High-level languages give the most hardware control because they are easy to read. FThe same program can run on different types of computer with little or no change, because it is not tied to one processor.

Definitions

high-level vs low-level

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
High-level code is easy to read _______ it uses English-like words.
2.
Low-level code is machine _________ because it is written for one type of processor.
3.
Low-level languages give ______ control of the hardware, so they suit device drivers.
4.
__________ code is portable but gives less control of the hardware.
5.
Four criteria: readability, debugging, machine ____________, hardware control.

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A level = "high"
B readable = True
C portable = True
D hardware_control = "full"
Question 2
A level = "high"
B portable = False
C hardware = "direct"
Question 3
A level = "low"
B if level == "low":
C print("Hard to debug")
D print("Portable")
Question 4
A level = "high"
B if level = "high":
C print("Easy to read")
Question 5
A level = "high"
B if level == "high":
C print("Easy to debug)
D else:
E print("Hard to debug")

Answer Key

Advantages and disadvantages of high-level and low-level languages
Section A: Quick Questions
Q1
B — They are easier to read and write because they use English-like words
Q2
A — High-level, because the code is easier to read and understand
Q3
A — High-level: the same code can run on different processors once translated
Q4
A — Low-level language
Q5
B — Less control over the hardware, because the translator hides the detail
Section B: Match the Pairs
Q1
high-level: portable → The same program can run on different types of computer with little or no change, because it is not tied to one processor.
Q2
low-level: direct hardware control → The programmer can control memory, registers and other hardware directly, which suits device drivers and embedded systems.
Q3
High-level code is easier to read, write and debug because it uses English-like words and statements. → IF score >= 50 THEN PRINT "Pass"
Q4
Low-level code is hard to read and debug because each line is a single machine-level instruction. → LDA 20 ADD 21 STA 22
Q5
Low-level languages are portable because they work on every type of computer. → Low-level languages are machine dependent, so they only work on the processor they were written for. High-level languages are the portable ones.
Q6
High-level languages give the most hardware control because they are easy to read. → High-level languages give less direct hardware control because they hide the hardware details. Being easy to read does not give more control.
Section C: Definitions
Q1
high-level vs low-level — High-level is easy to read, debug and portable but gives less hardware control; low-level is hard to read and machine dependent but gives direct hardware control.
Section D: Fill in the Blanks
Q1
High-level code is easy to read because it uses English-like words.
Q2
Low-level code is machine dependent because it is written for one type of processor.
Q3
Low-level languages give direct control of the hardware, so they suit device drivers.
Q4
High-level code is portable but gives less control of the hardware.
Q5
Four criteria: readability, debugging, machine independence, hardware control.
Section E: Spot the Error
Q1
D — High-level languages give LESS control of the hardware because the translator hides it. Direct hardware control belongs to low-level languages, so it should be "less".
Q2
A — The other lines describe a low-level language (not portable, direct hardware access). Line 1 should say level = "low" to match.
Q3
D — Low-level code is written for one type of processor, so it is machine dependent and not portable. The line should print "Machine dependent".
Q4
B — A single = assigns a value. A comparison in an if statement needs ==, so the line should be if level == "high":.
Q5
C — The string is missing its closing quote, which is a syntax error. It should be print("Easy to debug").