// captest.cc // // Fixed income binomial option pricing model: test // #include #include "cap.h" main() { f_i_bin c2; double caprate,rzero; cout << "\nType the cap rate, a space, the initial" << " rate, and then ENTER." << "\n" << "Make the cap rate negative to terminate." << "\n\n"; cout << "State rates in percent per annum (without the " << "percent sign).\n\n"; while(1) { cout << "cap-rate initial-rate: "; cin >> caprate >> rzero; if(!cin) { cout << "\nError: expected cap-rate initial-rate\n" << "Terminating\n" << endl; return(1);} if(caprate<0.0) { cout << endl; return(0);} cout << "cap value = " << c2.cap(caprate/100.0,rzero/100.0) << "\n\n";}}