Interactive Shutdown script

Hello folks.

I will start out by saying as far as unix/linux scripting goes I know less about it than i do about giving birth (I'm a guy hehe). I am looking to make a shutdown script that will either shut down the system or reboot it using one of the shutdown run methods IE init 2 - 5 or a base shutdown init 6. As you can see I've done some research but i need help with formatting it since I've not found much in the way of what commands are available for perl or bash or anything else for that matter. Since this is for a class I'm not asking for a full script but do ask for ideas how it should look so I can write a workable product myself. Thank you everyone for your assistance.

Moderator comments were removed during original forum migration.