Hall Effect Speed and Distance Sensor Code

I know which equations I would utilize to be able to determine the speed, but I need help on exactly how to program the arduino to use those equations. I know very little about coding and simply was able to get this far in this code because it was supplied to me as I inherited this arduino and the codes from a friend. Could someone give me an example code of how I would program the arduino to calculate and display distance?