Jan-04-2019, 03:56 AM
For the time limit, you'll need multithreading and set up a race condition. Essentially, you need two threads - one for user input and one for the timer. The timer thread would send a null answer after three seconds once activated. So, the user will have to provide an answer before the timer does.