Ask Question
23 November, 06:04

A. A programmer wrote a software delay loop that counts the variable (unsigned int counter) from 0 up to 40,000 to create a small delay. If the user wishes to double the delay, can they simply increase the upperbound to 80,000?

b. If the code contains a delay loop and we noticed that no delay is being created at run-time. What should we suspect during debugging?

+1
Answers (1)
  1. 23 November, 07:27
    0
    The objective here is to determine if the programmer can simply increase the upperbound to 80,000.

    Of course Yes, The programmer can simply increase the delay by doubling the upperbound by 80000. The representation can be illustrated as:

    (int : i = 0; i < 40,000; i + +)

    {

    / / delay code

    }

    Which can be modified as:

    (int : i = 0; i < 80,000; i + +)

    {

    / / delay code

    }

    b) If the code contains a delay loop and we noticed that no delay is being created at run-time. What should we suspect during debugging?

    Assuming there is no delay being created at the run-time,

    The code is illustrated as:

    For (int : i = 0; i < 0; i + +)

    {

    / / delay code which wont

    //execute since code delay is zero

    }

    we ought to check whether the loop is being satisfied or not. At the Initial value of loop variable, is there any break or exit statement is being executed in between loop. Thus, the aforementioned delay loop wont be executed since the loop wont be executed for any value of i.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “A. A programmer wrote a software delay loop that counts the variable (unsigned int counter) from 0 up to 40,000 to create a small delay. If ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers