Please answer question 3 and 4 with a clear handwriting or just type it if it po
ID: 3874926 • Letter: P
Question
Please answer question 3 and 4 with a clear handwriting or just type it if it possible
Please answer question 3 and 4 with a clear handwriting or just type it if it possible
3. For a single a given computer, would you expect a translated program to execute faster or slower than an interpreted program. Justify your answer in a few sentences. 4. Discuss a circumstance where an interpreted program would execute slower than a translated program. (Hint: how are the assumptions different than the prior exercise?)Explanation / Answer
3.
For a singled a given PC Two (related) reasons
To begin with, the interpreted language has the overhead of interpretation on each time the source code guideline is executed.Each time a line of BASIC is achieved, it will be deciphered without even a second's pause - each time which takes a great deal of work.In differentiate, with C that interpretation happens just once at compliation; at that point each time the code is achieved it is executed as machine code, as of now accelerated
Second, on the grounds that the translated code is "nearby" it just thinks about that line: so it can't do much else sharp than run it - and it tries to do that as quick as could reasonably be expected, so it doesn't have any chance to be savvy.
A compiler can take as much time as is needed, it can be exceptionally cunning - and it can "investigate" the entire of the code.So it has significantly more instruments to work out how to make code faster.It has a considerable measure of traps and systems it can utilize (circle unrolling, dispensing with code, including libraries and so forth etc)and if that takes a ton of time - no issue, since that exclusive happens once, and the execution quickening will more than remunerate obviously, as dependably there are genuine complexities and diverse devices may suit distinctive requirements.