Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi. I'm not good with C++. But I have to code this in little function is C++. I'm trying to print out all the values

image text in transcribed

Hi. I'm not good with C++. But I have to code this in little function is C++. I'm trying to print out all the values of BSM_European_call from sigma 0.1 to 1.0 using given values of S,K, r, q, sigma, T, t0. It's not printing the correct values. I think I need to use pointers or pass by reference but I'm really not sure how to do it in C++. Please help.

test-this.cpp 4 #includevector 6 using namespace std; 7 8 double cum norm (double x) 10 const double rootsqrt(0.5) return 0.5* (1.0 erf(x*root)); 12 13 double BSM-European-call(int S, int K, double r, double q, double & sig, double T, int taj 15 v 16 17 const double d1-(log(S/K)+(r-q)*(T-to))/F +0.5*F 18 19 20 21 22int main(int argc, char* argv[]) 23 24 25 26 27 28 29 30 31 32 const double F sig*sqrt (T-te); const double d2 d1 -F; return (S*exp ((-1*q) *(T-te)) cum_norm (d1) - (K*exp ((-1*r)*(T-te))) cum_norm (d2); int rc; int rs; int S-90; int K-100; double r 0.014; double q0.02; double sigma = 1.0; double T - 1; int t0 = 0; 34 35for (double m 0.1; m

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

6. Describe to a manager the different types of distance learning.

Answered: 1 week ago

Question

1. Explain how new technologies are influencing training.

Answered: 1 week ago