/*@@@@@@@@@@@@@@@@@@@@@@@@ EuropeanPut.h @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 Random Option Pricing
 Summer 2002
 Authors: A. Korobchevsky
          S. Ferrando
 Ryerson University ALL RIGHTS RESERVED
 
 Purpose: Implements the European Put Option

 Instance variables:
          K - Strike price
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

#ifndef EUR_PUT_H__
#define EUR_PUT_H__

#include "Derivative.h"

struct EuropeanPut : Derivative
{  



  /*********************** EuropeanPut *******************************
   * Function: EuropeanPut
   * Purpose: Constructor
   * Param: K - Strike price
   * Returns: N/A
   ********************************************************************/
  EuropeanPut(int 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 *************************************
   * Purpose: Returns the European Put Option payoff
   * Param: Final stock price
   * Returns: option payoff
   * Precondiion: Underlying and derivative parameter must be initialized
   ********************************************************************/
  double payOff(double ST)
  { return 0 > K - ST ? 0 : K - ST;
  }




  /*********************** 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:
    int K;
};

#endif
