ok i think you need some starter help..
1.
pipes in linux are the commands that you add to each other like a chain...for example, using ps -ef you can list all your running processes und with grep init you can select the lines including init in them..piping them is just combining them
2.you need to get familiar with bash scripting..
there are good tutorials on internet..here is one them
http://www.linuxconfig.org/Bash_scripting_Tutorial
just forget your homework for some time, and read this tutorial(which will also give you some ideas about using the pipes)
then start typing your code..if you have problems then paste your code here and ask questions..but do not expect an whole code from someone else..
i hope this one helps a bit