      $set ooctrl(+p) ooctrl(-f)
       
      *>-----------------------------------------------------------
      *> Class description
      *>-----------------------------------------------------------
       class-id. javaCalc
                 inherits from javabase.

       object section.
       class-control.
           javaCalc is class "javacalc"
      *> OCWIZARD - start list of classes
           javabase is class "javabase"
      *> OCWIZARD - end list of classes
      *>---USER-CODE. Add any additional class names below.

           .

      *>-----------------------------------------------------------
       working-storage section. *> Definition of global data
      *>-----------------------------------------------------------

      *>-----------------------------------------------------------
       class-object.   *> Definition of class data and methods
      *>-----------------------------------------------------------
       object-storage section.
       01 currentRate   pic 9(2).9(2) value 0.
       01 currentRate-x pic x(5) redefines currentRate.

      *> OCWIZARD - start standard class methods
      *> OCWIZARD - end standard class methods

      *>---------------------------------------------------------------
       method-id. "setInterestRate".
       local-storage Section.
      *>---USER-CODE. Add any local storage items needed below.
       linkage Section.
       01 rate                   pic x(5).
       procedure division using by reference rate.

      *>---USER-CODE. Add method implementation below.
           move rate to currentRate-x

       exit method.
       end method "setInterestRate".
      *>---------------------------------------------------------------


      *>---------------------------------------------------------------
       method-id. "getInterestRate".
       local-storage Section.
      *>---USER-CODE. Add any local storage items needed below.
       01 rate-x                 pic 9(2).9(2).
       linkage Section.
       01 rate                   pic x(5).

       procedure division returning rate.

      *>---USER-CODE. Add method implementation below.
           move currentRate-x to rate

       exit method.
       end method "getInterestRate".
      *>---------------------------------------------------------------


       end class-object.

      *>-----------------------------------------------------------
       object.         *> Definition of instance data and methods
      *>-----------------------------------------------------------
       object-storage section.

      *> OCWIZARD - start standard instance methods
      *> OCWIZARD - end standard instance methods

      *>---------------------------------------------------------------
       method-id. "calcSimpleInterest".
       local-storage Section.
      *>---USER-CODE. Add any local storage items needed below.
       01 rate-x                 pic x(5).
       01 total-c                comp-2.
       linkage Section.
       01 amount                 comp-2.
       01 years                  pic x(4) comp-5.
       01 total-x                pic x(10).
       01 total                  pic 9(7).9(2) redefines total-x.

       procedure division using by reference amount
                          by value years
                          returning total-x.

      *>---USER-CODE. Add method implementation below.
           invoke javacalc "getInterestRate" returning rate-x
           compute total-c = function numval (rate-x)
           multiply amount by total-c
           divide 100 into total-c
           multiply years by total-c
           add amount to total-c
           move total-c to total
       exit method.
       end method "calcSimpleInterest".
      *>---------------------------------------------------------------


      *>---------------------------------------------------------------
       method-id. "calcCompoundInterest".
       local-storage Section.
      *>---USER-CODE. Add any local storage items needed below.
       01 rate-x                 pic x(5).
       01 rate-c                 comp-2.
       01 total-c                comp-2.
       linkage Section.
       01 amount                 comp-2.
       01 years                  pic x(4) comp-5.
       01 total-x                pic x(10).
       01 total                  pic 9(7).9(2) redefines total-x.

       procedure division using by reference amount
                          by value years
                          returning total-x.

      *>---USER-CODE. Add method implementation below.
           invoke javacalc "getInterestRate" returning rate-x
           compute rate-c = function numval (rate-x)
           move amount to total-c
           perform years times
               compute total-c = total-c * (1 + rate-c / 100)
           end-perform
           move total-c to total

       exit method.
       end method "calcCompoundInterest".
      *>---------------------------------------------------------------


       end object.

       end class javaCalc.
