you say "program". I'm assuming what is requested is actually a shell script. If so, read on.
I think the stat command is what you are looking for. It provides all sorts of information about files. For example for the access time of a file called "file.txt" you can do:
stat --format %x file.txt
You may find that the posix time (or "seconds since Epoch") is more useful to you. Read the man page for stat to get details.
Next you'll need to learn how to use stat in a script, but presumably the course associated with this particular homework gave some instruction on shell scripting.