Advertisement
Gireada

AABAP

Mar 14th, 2019
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *& Report Y_GRIGORE_LAB5
  3. *&
  4. *&---------------------------------------------------------------------*
  5. *&
  6. *&
  7. *&---------------------------------------------------------------------*
  8.  
  9. REPORT Y_GRIGORE_LAB5.
  10.  
  11. DATA int TYPE I.
  12. int = 10.
  13.  
  14. DATA float TYPE F.
  15. float = '1.234'.
  16.  
  17. Data ari TYPE D.
  18. ari = '20190307'.
  19.  
  20. DATA ora TYPE T.
  21. ora = '103719'.
  22.  
  23. DATA nume TYPE C.
  24. nume = 'GRIGORE'.
  25.  
  26. WRITE: int, / float, / ari ,/ ora ,/ nume.
  27.  
  28.  
  29. *& DATA f TYPE I OCCURS 3.
  30. *& INSERT 1 INTO f INDEX 0.
  31. *& INSERT 2 INTO f INDEX 1.
  32. *& INSERT 3 INTO f INDEX 2.
  33.  
  34. DATA numar_div TYPE I.
  35. DATA NUMAR_DOI TYPE I.
  36. DATA NUMAR_TREI TYPE I.
  37. DATA NUMAR_CINCI TYPE I.
  38. DATA NUMAR_SAPTE TYPE I.
  39.  
  40. numar_div = 25.
  41.  
  42. NUMAR_DOI = numar_div MOD 2.
  43. NUMAR_TREI = numar_div MOD 3.
  44. NUMAR_CINCI = numar_div MOD 5.
  45. NUMAR_SAPTE = numar_div MOD 7.
  46.  
  47. If NUMAR_DOI = 0.
  48. WRITE: numar_div , 'este divizibil cu 2'.
  49. ENDIF.
  50. If NUMAR_TREI = 0.
  51. WRITE: numar_div , 'este divizibil cu 3'.
  52. ENDIF.
  53. If NUMAR_CINCI = 0.
  54. WRITE: numar_div , 'este divizibil cu 5'.
  55. ENDIF.
  56. If NUMAR_SAPTE = 0.
  57. WRITE: numar_div , 'este divizibil cu 7'.
  58. ENDIF.
  59.  
  60.  
  61. DATA numar_text TYPE I.
  62.  
  63. numar_text = 10.
  64.  
  65. CASE numar_text.
  66. WHEN 0.
  67. WRITE: / 'Zero'.
  68. WHEN 1.
  69. WRITE: / 'Unu'.
  70. WHEN 2.
  71. WRITE: / 'Doi'.
  72. WHEN 3.
  73. WRITE: / 'Trei'.
  74. WHEN 4.
  75. WRITE: / 'Patru'.
  76. WHEN 5.
  77. WRITE: / 'Cinci'.
  78. WHEN 6.
  79. WRITE: / 'Sase'.
  80. WHEN 7.
  81. WRITE: / 'Sapte'.
  82. WHEN 8.
  83. WRITE: / 'Opt'.
  84. WHEN 9.
  85. WRITE: / 'Noua'.
  86. WHEN 10.
  87. WRITE: / 'Zece'.
  88. ENDCASE.
  89.  
  90.  
  91. DATA numar_1 TYPE F.
  92. DATA numar_2 TYPE F.
  93. DATA operator TYPE C.
  94.  
  95. operator = '+'.
  96. numar_1 = '10.20'.
  97. numar_2 = '20.30'.
  98.  
  99. DATA rezultat TYPE F.
  100. rezultat = 0.
  101. CASE operator.
  102. WHEN '+'.
  103. rezultat = numar_1 + numar_2.
  104. WHEN '-'.
  105. rezultat = numar_1 - numar_2.
  106. WHEN '*'.
  107. rezultat = numar_1 * numar_2.
  108. WHEN '/'.
  109. rezultat = numar_1 / numar_2.
  110. WHEN '%'.
  111. rezultat = numar_1 MOD numar_2.
  112. ENDCASE.
  113.  
  114. WRITE: / 'Rezultatul este: ', rezultat.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement