Write a function to compute the nth Fibonacci number. Use your function to solve Programming Exercise 3 from Chapter 3.
Exercise 3:
Write a program that determines the molecular weight of a hydrocarbon based on the number of hydrogen, carbon, and oxygen atoms. You should use the following weights: