Question
Create an interface, Stock derivatives, with two attributes viz., delta=0.5 and vega=0.2 which are used to determine option premium of a stock. Also add an
Create an interface, Stock derivatives, with two attributes viz., delta=0.5 and vega=0.2 which are used to determine option premium of a stock. Also add an abstract method
Find Premium. Write a class Options which implements interface Stock derivatives. Options class also contains two attributes called stock price and option premium
This class contains a constructor to initialize stock price. Implement Find Premiumo which determines option premium based on stock price. By using following formula option premium=stock price*delta *vega. Besides implementation of Find Premium(, add another method called cal op0 which changes stock price randomly between 0 and 9 for 10 times and each time display updated option premium using
Find Premium(. To generate random number use inbuilt method Math.random(. Write a main() method that tests in another class named Stock.
Step by Step Solution
3.41 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
Sure Heres the implementation of the StockDerivatives interface and the Options class as described j...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started