// crrtest.cc // // Binomial option pricing model: test // #include #include "crr.h" main() { crr c1; double stockP,strikeP; cout << "\nType the stock price, a space, the strike" << " price, and then ENTER." << "\n" << "Make the stock price negative to terminate." << "\n\n"; while(1) { cout << "stock-price strike-price: "; cin >> stockP >> strikeP; if(stockP < 0.0){ cout << "\nBye!\n" << endl; return(0);} if(!cin){ cout << "\nError: enter stock-price strike-price\n" << "Terminating\n" << endl; return(1);} cout << "call option value = " << c1.eurcall(stockP,strikeP) << "\n\n";}}