Well,
For one thing, this is THE assignment for our course. Rather than relying on others to GIVE you the code, you should sit down and do some math on the conversion. Plenty of samples out there...