SoftwareMining - Business Rule Extraction and Documentation 

Business Rule  
COBOL Documentation
LOAN.html
Persistent Records:
Signature (From Linkage Section) 
Working Storage Section

 

Analyst's Description/Comments
Data Filters Applied to this rule:
  • NONE
Statement Category Filters: The following statement types have been filtererd out
  • Screen Handling Statements

Business Rule Code
/**
 * main_M10
 */
public void main_M10 ()
{
  displaySection("clrScreen");
  displaySection("wsData");
  acceptSection("wsData");
  if (idata.getLoanLength().getAsInt() > 4) {
    idata.setStartYear(idata.getLoanLengthValue() - 4);
  } else {
    idata.setStartYear(0);
  }
  if (idata.getInterestRate().getAsDouble() > 0.4) {
    idata.setStartInterest(idata.getInterestRate().getAsDouble() - 0.4);
  } else {
    idata.setStartInterest(0.0);
  }
  idata.setYearRow(1);
  idata.getDspNoYrs(0).setValue("% RATE->");
  idata.setNextYear(idata.getStartYear());
  // initialize loop variable
  idata.setYearRow(2);

  while ( true ) {
    // termination condition 
    if (idata.getYearRow().getAsInt() == 11) {
      break;
    }
    // COBOL String Command 
    ACMStringProcessor.process(idata.getDspNoYrs(idata.getYearRowValue()-1), 
      new String[] {idata.getNextYear().getAsStringFormatted(), " Yrs:"},
      new String[] {"", ""}
    );

    perform("doNextRow_M20");
    idata.setNextYear(idata.getNextYear().getAsInt() + 1);

    // increment loop variable
    idata.setYearRow(idata.getYearRowValue() + 1);
  }
  display(idata.getWsDisplayResult(), 15, 1);
  acceptSection("ssContinue");
  stop();
}

/**
 * doNextRow_M20
 */
public void doNextRow_M20 ()
{
  idata.setNextInterest(idata.getStartInterest());
  // initialize loop variable
  idata.setInterestCol(1);

  while ( true ) {
    // termination condition 
    if (idata.getInterestCol().getAsInt() == 10) {
      break;
    }
    idata.getDspResult(0, idata.getInterestCol().getAsInt() - 1).setValue(idata.getNextInterest());
    perform("calculate_M30");
    idata.getDspResult(idata.getYearRow().getAsInt() - 1, idata.getInterestCol().getAsInt() - 1).setValue(idata.getNextResult());
    idata.setNextInterest(idata.getNextInterest().getAsDouble() + 0.1);

    // increment loop variable
    idata.setInterestCol(idata.getInterestColValue() + 1);
  }
}

/**
 * calculate_M30
 */
public void calculate_M30 ()
{
  idata.setIntdec(idata.getNextInterest().getAsDouble() / (12.0 * 100.0));
  idata.setNummonths(idata.getNextYearValue() * 12);
  idata.setNextResult(idata.getPrincipal().getAsDouble() * (idata.getIntdec().getAsDouble() / (1.0 - (Math.Pow((1.0 + idata.getIntdec().getAsDouble()), - idata.getNummonthsValue())))));
}