Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

C++ for Financial Engineering

Assignment 1: An interactive Black-Scholes pricer

Instructions
ˆ This is an individual assignment.
ˆ Assignment Weight: 10% of the total nal assessment mark.
ˆ YOUR COMPLETED ASSIGNMENT MUST BE SUBMITTED NO LATER THAN
12:00 Tuesday 19th February 2019.
ˆ Submit an electronic copy on BlackBoard BEFORE 12:00 p.m. on the submission
date.
ˆ Submit source code les only. No need to write a report.
ˆ Any late submissions will be dealt with according to school regulations.

Introduction

You are going to implement an interactive application that computes some Black-Scholes
formulas. You are expected to:
ˆ test and debug your program extensively.
ˆ write clear and well organized code.
The accompanying C++ source le contains some functions to compute:
ˆ Call pricing using Black-Scholes formula.
The functions are not currently used in the main() function which is currently not yet
implemented.

1
1 Using the code and Input/Output
Create a Visual Studio project and add the source le to it. Write "User interface" code
in the main() function to use the functions and test them. The main() function
ˆ greet the user, then in a loop
 request inputs from the user
 validate the inputs
 print message errors for invalid inputs and allow for up to 5 attempts for each
input
 after 5 failed attempts to enter valid inputs, print an error message and exit
 calculate call price with the Black-Scholes formula.
ˆ ask the user if he/she wants to price another option or no.
ˆ if yes, repeat the steps.
ˆ if no, print an exit message and exit.

2 Implement some more formulas


ˆ Put formula
ˆ Call and Put delta, gamma, and theta formulas
Extend the user interface to also do put pricing and the greeks that you have implemented.
Your program should now ask the user what he wants to compute in each iteration

You might also like