Mega2560+LCD Keypad Shield+motor

Hi,I'm a Taiwanses. My English is not very well. But I have a problem.

I want my LCD Keypad Shield can set clock(alarm clock). When time's up,the motor will run 5 seconds and stop.

Set time --> clock alarm --> motor run(5s) --> Stop

How do I write the program??