Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We begin with the simple case where we know the bond yield and wish to calculate the bond price. We also begin with the simple

image text in transcribed
We begin with the simple case where we know the bond yield and wish to calculate the bond price. We also begin with the simple case of a newly issued bond. Recall the formula is B = 1/2 c/1 + 1/2 y + 1/2 c/(1 + 1/2 y) +... + 1/2 c/(1 + 1/2 y)^n - 1 + F + 1/2 c/(1 + 1/2 y)^n. Write a function to calculate the above sum. The inputs are (i) double F, (ii) double c, (iii) double y, (iv) int n. The output is (v) double & B. The input value of the yield y is percentage, so if the yield is 5% then y = 5. Hence remember to compute an internal variable y_decimal = 0.01 y in your code, to avoid "factor of 100" errors. The function signature is void price_from_yield(double F. double c. doable y. int n. double k B): Write the function and call it with some sample inputs. (You must write a main program.) Here are some tips to help you to check that your code is working correctly. To keep things simple, use F = 100 in all your tests. There is no point in being too clever. If F = = 100, then if the yield equals the coupon y = c, you should obtain B = F (= 100). Put y = 0. Then the value of B is a straight sum of the values of the cashflows. Since there are n cashflows of the coupons, obviously B = F + nc/2. Your program should give this value. The bond price B decrease as the yield y increase. (This is in fact a general theorem. It was proved in the 1930s, I think.) Put c = 0. This is known as a zero coupon bond and they do exist. A zero coupon bond pays only one cashflow, which is to pay the face value at maturity. In that case the formula is B_ coupon = F/(1 + 1/2 y)^n. This is a very simple formula and you should be able to calculate the above formula independently (use Excel, for example). Hence you should be able to validate your function, for a zero coupon bond

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

ISBN: B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

What organizations or professional societies should you join?

Answered: 1 week ago

Question

Conduct a needs assessment. page 269

Answered: 1 week ago

Question

How would you assess the value of an approach like this?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago