/*@@@@@@@@@@@@@@@@@@@@@@@@ EuropeanCall.h @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 Random Option Pricing
 Summer 2002
 Authors: A. Korobchevsky
          S. Ferrando
 Ryerson University ALL RIGHTS RESERVED
 
 Purpose: Implements the European Call Option
 
Instance variables:
          K - Strike price
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

#ifndef EUR_CALL_H__
#define EUR_CALL_H__

#include "Derivative.h"

struct EuropeanCall : Derivative
{
 


  /*********************** EuropeanCall *******************************
   * Function: EuropeanCall
   * Purpose: Constructor
   * Param: K - Strike price
   * Returns: N/A
   ********************************************************************/
  EuropeanCall(double K)
  { this->K = K;
  }




  /*********************** init ***************************************
   * Function: init
   * Purpose: Initialises utility variables
   * Param: N/A
   * Returns: N/A
   * Note: Empty for path independent derivatives
   ********************************************************************/
  void init()
  {
  }




  /*********************** payOff *************************************
   * Function: payOff 
   * Purpose: Returns the European Call Option payoff
   * Param: Final stock price
   * Returns: option payoff
   * Precondiion: Underlying and derivative parameter must be initialized
   ********************************************************************/
  double payOff(double ST)
  { return 0 > ST - K ? 0 : ST - K;
  }




  /*********************** update *************************************
   * Function: update
   * Purpose: Updates the intermidiate values between timesteps for
   *          path-dependent derivatives.
   * Param: Stock value
   * Returns: N/A
   * Note: Empty for path independent derivatives
   ********************************************************************/
  void update(double St)
  {
  }




  private: 
    double K;
};

#endif
