Which statement best describes the main difference between high-level and low-level programming languages?
Think about how easy it is for humans to understand the code.
High-level languages use words and structures similar to human language, making them easier to read and write. Low-level languages are closer to the machine's binary code, making them harder to read but faster for the computer.
Consider the following two code snippets. What will be the output of each?
Python code:
print('Hello, World!')Assembly code (conceptual):
MOV AH, 09h LEA DX, message INT 21h message DB 'Hello, World!$'
Think about what each code snippet is designed to do.
Both snippets output the text 'Hello, World!'. Python code is high-level and easy to read, while assembly code is low-level but can produce the same output by directly controlling hardware.
Look at the following code snippet and identify whether it is written in a high-level or low-level language:
LOAD R1, #5 ADD R1, R2 STORE R1, 1000h
Notice the use of registers and memory addresses.
This code uses instructions that directly manipulate registers and memory addresses, which is typical of low-level languages like assembly.
Which of the following correctly compares high-level and low-level languages in terms of execution speed and ease of use?
Think about what happens when code is closer to machine instructions.
Low-level languages run faster because they are closer to machine code but are harder for humans to write and understand. High-level languages are easier to use but usually run slower due to extra processing.
You need to write a program that controls a robot's hardware directly for precise timing and performance. Which type of language should you choose and why?
Consider the need for precise control and speed.
Low-level languages like assembly allow direct control of hardware and precise timing, which is essential for robotics and performance-critical tasks.