Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A programmer uses an interpreter while she writes a game. When the game is finished, she compiles it before selling it.
Explain two reasons for using the interpreter while writing, and two reasons for compiling the finished game. The question is worth 4 marks.
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.
Interpreter while writing (any two, 1 mark each):
Compiler for the finished game (any two, 1 mark each):
Watch out. "The compiler is better" is not a reason. Say what it gives that the interpreter does not.
Log in to join the discussion.
Loading…