Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Say whether each statement is about a compiler or an interpreter.
A compiler translates the whole code at once, before executing it, produces an executable file, and gives an error report for the whole code. An interpreter translates and executes the code line by line and stops when it finds an error. An interpreter is mostly used when developing a program; a compiler translates the final program.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Compiler: (a), (c) and (e). It translates everything first, makes an executable file, and reports every error. That is 3 statements.
Interpreter: (b), (d) and (f). It goes line by line, stops at an error, and is mostly used while developing. That is 3 statements.
Answer: 3 about a compiler and 3 about an interpreter.
Log in to join the discussion.
Loading…