home *** CD-ROM | disk | FTP | other *** search
/ Sams Cobol 24 Hours / Sams_Cobol_24_Hours.iso / source / ch09 / CHAPT09D.COB < prev    next >
Text File  |  1998-09-14  |  2KB  |  40 lines

  1. 000010 @OPTIONS MAIN
  2. 000020 Identification Division.
  3. 000030 Program-Id.  Chapt09d.
  4. 000031* Complex Evaluate Example 2
  5. 000040 Environment Division.
  6. 000050 Configuration Section.
  7. 000051 Source-Computer.  IBM-PC.
  8. 000055 Object-Computer.  IBM-PC.
  9. 000056 Data Division.
  10. 000057 Working-Storage Section.
  11. 000058 01  Sale-Price          Pic 9(4)v99 Value 7547.00.
  12. 000059 01  Commission-Amount   Pic 9(4)v99 Value Zeros.
  13. 000072 Procedure Division.
  14. 000159 Chapt09d-Start.
  15. 000160     Evaluate True Also True
  16. 000161       When Sale-Price >= 1000 Also Sale-Price * .5 > 750.00
  17. 000162            Move 750.00 To Commission-Amount
  18. 000163       When Sale-Price >= 1000 Also Any
  19. 000164            Compute Commission-Amount = Sale-Price * .5
  20. 000165       When Sale-Price >= 500  Also Sale-Price * .25 > 150.00
  21. 000166            Move 150.00 To Commission-Amount
  22. 000167       When Sale-Price >= 500  Also Any
  23. 000168            Compute Commission-Amount = Sale-Price * .25
  24. 000169       When Sale-Price >= 250  Also Sale-Price * .10 > 30.00
  25. 000170            Move 30.00 To Commission-Amount
  26. 000171       When Sale-Price >= 250  Also Any
  27. 000172            Compute Commission-Amount = Sale-Price * .10
  28. 000173       When Other
  29. 000174            Compute Commission-Amount = Sale-Price * .05
  30. 000175            If Commission-Amount < 1.00
  31. 000176               Move 1.00 To Commission-Amount
  32. 000177            End-If
  33. 000178            If Commission-Amount > Sale-Price
  34. 000179               Compute Commission-Amount = Sale-Price * .75
  35. 000180            End-If
  36. 000181     End-Evaluate
  37. 000188     Display "Sale Price " Sale-Price
  38. 000189     Display "Commission " Commission-Amount
  39. 000190     Stop Run
  40. 000217     .