I guess there are tons of apps like this out there, making one would be reinventing the wheel.
Another way is to use the windows run box, as i usually do:
the following shuts down the computer in the given seconds:
shutdown -s -t TIME_IN_SECONDS
the following restarts the computer in the given seconds:
shutdown -r -t TIME_IN_SECONDS