Design a sequential circuit that does the same as your C code.
You need a clock to count so you can make a counter that counts out time, use the output of the counter to know when to turn off the output. Enable the counter when you have a change in the input signal...You pretty much did all that in the C code. The hardware to do this is really simple. clocks, counters, compare, and flip-flops to hold enables, input, and output.
I get the impression that some of the universities these students attend must not be very good, I've seen way too many posts like this. Their curriculum seems to make them software engineers with no understanding of logic design. Isn't logic design required in software design?