Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3 (5 points) A Wait Until Neat ms Multiple function, whose inpat is wired to a c

ID: 3591009 • Letter: 3

Question

3 (5 points) A Wait Until Neat ms Multiple function, whose inpat is wired to a constant fvalue 50, placed in the same loop as a section of code that takes anywhere from 53 tas to 60 ns to ecute (a) (2 points) If the code section requires exactly 57 ms to execute during the fourth loop iterationw y milliseconds elapse after the code section completes execution in the fourth iteration and the start of the fifth iteration? To receive credit, justify your answer in one or two short sentences, or sketch a time-line b) (3 points) Will your anewer in part (a) be the same for every loop iteration? To recive credit, jastify your answer in one or two short sentences, or sketch a time-line

Explanation / Answer

1. Fourth loop iteration will include one run of wait until next function.

So loop definition will be something like.

Loop from i=0 .....n

Begin

Code section-- execution time 57 ms

Wait(50) -- wait for 50 ms

End

So total elapsed time = 57+50=107 ms

2. As mentioned above, total time taken in each iteration will be sum of code execution time and wait time. Hence, yes it is applicable to all iterations. Refer to sample loop definition.