Quiz 2 Answer Key
Programming Languages • High Level vs Low Level • Compiled vs Interpreted
Use this to check your understanding and fix mistakes after the quiz.
Question 1
A low level programming language:
- is slower to execute than a high level language
- can be run on any platform without changes
- requires less execution time than a high level language
- is friendlier to humans than a high level language
Correct Answer: C
requires less execution time than a high level language
Why: Low level languages are closer to the computer.
Because: They usually run faster and give more direct control over hardware.
Question 2
True or False: Most of the widely used computer programs of today are high level languages.
- Both are equally common
- It depends on the computer’s speed
- False
- True
Why: Most popular modern languages are high level.
Because: They are easier for people to read, write, debug, and use for many kinds of programs.
Question 3
Which of the following is a difference between a compiled and an interpreted language?
- Programs written in a compiled language are run directly by the computer while interpreted languages need additional software to run.
- A compiled language is considered low level while an interpreted language is considered high level.
- Programs written in an interpreted language can be partially run before an error is found, while a compiled language won’t run if any errors exist.
- Compiled programs can run on any computer without changes.
Correct Answer: C
Programs written in an interpreted language can be partially run before an error is found, while a compiled language won’t run if any errors exist.
Why: An interpreted language runs line by line.
Because: Python can run the first part of a program, then stop exactly where the mistake happens. A compiled program usually has to pass the full check before it runs.
Question 4
You need to choose a language for two different projects: programming a robot’s movements and building a website for users. Which statement shows the best match?
- Use low level interpreted languages for both, so the same code works everywhere.
- Use a low level compiled language for the robot and a high level interpreted language for the website.
- Use high level compiled languages for both, since they run fastest on all machines.
- Use a high level interpreted language for the robot and a low level compiled language for the website.
Correct Answer: B
Use a low level compiled language for the robot and a high level interpreted language for the website.
Why: Different jobs need different strengths.
Because: A robot needs speed and hardware control, while a website is usually easier to build with a more human friendly language.
Question 5
Why does Python stop at line 8 when there is an error?
- Python runs your code one line at a time, stopping when it finds an error.
- Python turns your code into machine language before running it.
- Python waits until the very end to check for errors.
- Python compiles the whole program before running it.
Correct Answer: A
Python runs your code one line at a time, stopping when it finds an error.
Why: Python is interpreted.
Because: It reads and runs the program step by step, so it can tell you the exact line where the problem appears.