Recall & Review
beginner
What is a compiler?
A compiler is a tool that translates the whole program from a high-level language into machine code before the program runs. Think of it like translating a whole book into another language before reading it.
Click to reveal answer
beginner
What does an interpreter do?
An interpreter translates and runs a program line-by-line, like a translator who speaks sentence by sentence while someone is talking.
Click to reveal answer
beginner
Name one key difference between compiling and interpreting.
Compiling translates the entire program at once before running, while interpreting translates and runs the program one line at a time.
Click to reveal answer
intermediate
Why might a compiled program run faster than an interpreted one?
Because the whole program is already translated into machine code before running, the computer can execute it directly without translating during execution.
Click to reveal answer
beginner
Give a real-life analogy for how an interpreter works.
Imagine a tour guide translating a foreign language guidebook aloud to a group as they walk through a museum, translating each part as they go.
Click to reveal answer
Which tool translates the entire program before running it?
✗ Incorrect
A compiler translates the whole program into machine code before execution.
What is a key feature of an interpreter?
✗ Incorrect
An interpreter translates and runs code one line at a time.
Which is generally faster to run after translation?
✗ Incorrect
Compiled programs run faster because they are fully translated before running.
Which analogy best describes a compiler?
✗ Incorrect
A compiler translates the entire program before execution, like translating a whole book first.
What happens if there is an error in a compiled program?
✗ Incorrect
Compilers check for errors during translation and show them before running the program.
Explain in your own words how a compiler works and why it might make a program run faster.
Think about translating a whole book before reading it.
You got /4 concepts.
Describe how an interpreter runs a program and give a real-life example to help explain it.
Imagine someone translating a speech as it happens.
You got /3 concepts.