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

You’ve been asked to add some wait time to this program for user input, the func

ID: 3727907 • Letter: Y

Question

You’ve been asked to add some wait time to this program for user input, the function delay() is good for creating pauses in operation such as these, but not typically good for timing code events.

(1)What built in function allows you to select a more precise interval?

There’s more than one way to deal with input conformation, this program has used one method by which a function calls itself.

(2)What is the name of this type of function call?

(3)What other ways could you accomplish this process if the function lacked the internal call?

Not all communications need to be in human readable format, but it helps when you’re testing your code.

(4)If some of the functions got their input from another machine, what changes would you make to your code?

Explanation / Answer

1) Use sleep and nanosleep function from time.h to select more precise time interval

Sample code:

2) This function is used to suspend the execution of the calling thread for the specified time