/* (c) 1999-2005, Rony G. Flatscher, Wirtschaftsuniversitaet Wien, Austria Europe
   A *possible* solution to excercise # 14
*/

::CLASS  Euro   PUBLIC

::METHOD INIT
  EXPOSE denotation country exchangeRate currency
  USE ARG currency, country, denotation, exchangeRate
  self~INIT:super             /* let superclasses initialize too ... */
  IF ARG(5, "E") THEN self~amount = ARG(5)   /* 5th argument?        */
                 ELSE self~amount = 0

::METHOD amount            /* return present value */
  EXPOSE amount
  RETURN amount

::METHOD "amount="
  EXPOSE amount euro_amount exchangeRate
  USE ARG amount
  euro_amount = amount/exchangeRate

::METHOD denotation        /* return present value */
  EXPOSE denotation
  RETURN denotation

::METHOD euro_amount       /* return present value */
  EXPOSE euro_amount
  RETURN euro_amount

::METHOD "euro_amount="
  EXPOSE amount euro_amount exchangeRate
  USE ARG euro_amount
  amount = euro_amount*exchangeRate

::METHOD country           /* return present value */
  EXPOSE country
  RETURN country

::METHOD exchangeRate      /* return present value */
  EXPOSE exchangeRate
  RETURN exchangeRate

::METHOD currency          /* return present value */
  EXPOSE currency
  RETURN currency