1. Write a program to calculate a European option price using the Black-Scholes formula. The parameters, including current stock price, volatility, strike price, interest rate, time-to-maturity, and option type, should be user-defined.
2. Write a program to allow users to use the binomial tree procedure to calculate an option price. All the parameters should also be user-defined.
3. Try both programs to determine the following option value and compare the results. The stock price is $42 per share. A European call is 6 month away from its maturity. The strike price is $40. The risk-free interest rate is 10% per year, and the stock volatility is 20% per year.