Write a C++ program with an EuropeanOption class (with fixed strike price K). It should hold information such as option type (call or put), spot price (of the underlying asset), strike price, interest rate, volatility (of the underlying asset) and time to maturity. Constructors don’t accept illegal values. Implement a getPrice() function which gives the price of the option using path independent simulation of the stock prices. Using the following dynamics for the stock price with the constant values: dSt= rStdt + σStdWt S0= 100 K = 105 r = 0.02 σ = 0.05 T = 10. Add more features to the class it should contain four member functions to compute the numerical Greeks (getDelta() for spot price, getRho() for interest rate, getVega() for volatility, and getTheta() for time to maturity) of a given option.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- Implement a function alterCase in Python that converts a word to "alterCase". Given a word, using any mix of upper and lower case letters, the function then returns the same word, except that the first letter is upper case, the second is lower case, and then cases of letters alternate throughout the rest of the word. >>> alterCase('apple')'ApPlE'arrow_forwardWrite a program to build a calculator. Instead of a typical calculator which reads in-order expressions and evaluates them, build a calculator that takes in numbers and assigns the operations to yield the highest value expression. The current operations on the calculator only handle pairs of parentheses, and the operators for addition, subtraction, multiplication, and division. The calculator can rearrange the numbers if it helps find the optimal value. For example, the list:4.0 5.0 3.0 2.0 1.0using the calculator should find the optimal expression yielding the maximum value to be:4.0 * 5.0 * 3.0 * (2.0 + 1.0) = 180Input from the keyboard a list of up to 10 floating-point values from-100000.0to100000.0. Output to the screen a single floating-point value rounded to two decimal places representing the highest value expression that the calculator could create by inserting the symbols( ) + - * /into the given expression. Assume at least one number in the list and only the operators listed…arrow_forwardImplement a function or class to solve the Black-Scholed Model Partial Differential Equation. It should be able to price both European and American-style derivatives of arbitrary payoff structure (i.e. the payoff function should be a Callable). Implement full functionality: That is, calculate the price of both European and American options on dividend-paying stocks and be flexible to price other options besides standard calls and puts. Provide documentation: Provide docstrings and example usage for your implementation. It should be easy for someone looking at your code to understand how to call it and what the parameters mean. A short README.md file or example script would be useful.arrow_forward
- Give a concrete example of a function, where blackbox testing might give the impression that “everything’s OK,” while whitebox testing might uncover an error. Give another concrete example of a function where the opposite is true. You need to support both examples with test cases.arrow_forwardModify the GeometricObject classto implement the Comparable interface and define a static max method in theGeometricObject class for finding the larger of two GeometricObject objects.Draw the UML diagram and implement the new GeometricObject class. Writea test program that uses the max method to find the larger of two circles, the largerof two rectangles.arrow_forwardMake A Dice Simulator in Python. First, we import the library that allows us to choose random numbers. import random Now, we can generate a random number and save it in a variable, We will call it rolled Python library random has a function called randint (). The randint (min number, max number) requires 2 parameters (the lowest number and the highest number between we will pick our number randomly). In this case, our dice goes between 1-6. rolled = random.randint (1,6) If we want to show our selected number, we can use print (). Your code should look like this: import random rolled - random.randint(1,6) print(rolled) Nice, we already have our main engine working, now it's time to make it look more appealing. To do that we will add some improvements (we will use a new variable to store random generated numbers - rolled_num) import random rolled num - random.randint(1,6) print("You rolled: ", rolled num) If we run the code again, we should see a little message and the random number. Our…arrow_forward
- Implement the following in the .NET Console App. Write the Bus class. A Bus has a length, a color, and a number of wheels. a. Implement data fields using auto-implemented Properies b. Include 3 constructors: default, the one that receives the Bus length, color and a number of wheels as input (utilize the Properties) and the Constructor that takes the Bus number (an integer) as input.arrow_forwardUsing the Card.java class file, write a program to simulate a Deck of Cards. See Programming Project 8.7 (PP 8.7) from page 403 of your textbook (or view the attached image) for a description of what your program needs to do. Note that although the book description of the problem states that you should write the Card class, I do not want you to do that. You must use the Card file exactly as it is provided (NO modifications) and only write the DeckOfCards and Driver classes. public class Card{public final static int ACE = 1;public final static int TWO = 2;public final static int THREE = 3;public final static int FOUR = 4;public final static int FIVE = 5;public final static int SIX = 6;public final static int SEVEN = 7;public final static int EIGHT = 8;public final static int NINE = 9;public final static int TEN = 10;public final static int JACK = 11;public final static int QUEEN = 12;public final static int KING = 13; public final static int CLUBS = 1;public final static int DIAMONDS =…arrow_forwardI need help figuring out what i need to include in my python code for the Simulation Statistics part?arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY