amlxv

water

Nov 8th, 2019 (edited)
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.05 KB | None | 0 0
  1. ?? - Kalau nmpak tnda "//" atau "/* test */" tu maksudnya
  2. comment je yerr.
  3. ?? - Comment xdexecute oleh sistem.. so klau nk
  4. tulis sbgai peringatan masa hdapn blh je tpi ingat tau kena
  5. letak tnda palang 2 kali. e.g : // atau /**/
  6. -----------------------------------------------------------------------
  7. #include <iostream>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     int mark[5]; // klau nk fham apa fungsi [5] tu haaa. check notes dkat bhagian bwah skali tu yerr
  14.     int i, sum = 0; // 'i' tu utk loop
  15.     double avg; // guna "double" sbb avg majoriti dlm decimal num
  16.     int student = 0; // student mesti equal to 0 dulu sbb kita just nak update je nanti
  17.  
  18.    
  19.     for( i=0; i < 5; i++){  
  20.     // Ni loop yg pertama. Loop ni loop mcam biasa je.. cuma ade benda pelik sikit dekat bawah tu.. [i]. Loop ni utk
  21.     // user input mark yg student dpt. Lpastu mark yg user input tu akn disimpan dlm variable mark.
  22.  
  23.         cout << "Enter the student mark : ";
  24.         cin >> mark[i]; //haa ni kalau xtngok video from link yg saya bgi kat bawah tu mungkin pening skit apa benda [i] tuu :)
  25.  
  26.         sum = sum + mark[i];
  27.     }
  28.  
  29.     avg = sum / 5.0;     // dlm calculation avg kena divide by (5.0) ** kena dlm bentuk decimal. fhm2 lah
  30.  
  31.     for( i=0; i < 5; i++ ){
  32.  
  33.         if( mark[i] > avg ){ //Loop ke-2. Loop ni utk update bil student yg dpt mark > avg yg dh kita calculate dkat atas tu..
  34.  
  35.             student++;
  36.  
  37.         }
  38.     }
  39.  
  40.     cout << "\nRESULT : ";
  41.      cout << "\n" << student <<  " student get mark more than the average of quiz." << endl;
  42.  
  43.      return 0;
  44. }
  45.  
  46. -----------------------------------------------------------------------
  47.  
  48. N.O.T.E.S
  49.  
  50. * mark[5] tu ialah Array. Array blum blajar lgi rasanya.. hmm.. Miss sje je ni nk kenakan kita lgi :'<
  51. * Kalau nk belajar tntng array blh tngok video kat sini https://www.youtube.com/watch?v=vLnPwxZdW4Y&t=4425s atau baca je dkat sini https://www.w3schools.com/cpp/cpp_arrays.asp
  52. * Reference :
  53. - https://www.w3schools.com/
  54. - https://www.youtube.com/watch?v=vLnPwxZdW4Y
  55. - Klau xfhm pape pm je.
  56.  
  57. -----------------------------------------------------------------------
  58.  
  59. ```````_1111111_``````````````````````````````````````
  60. ```1$¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶$₫_```````````````````````````````
  61. `_111_```````1₫$¶¶¶¶¶¶¶¶¶₫_```````````````````````````
  62. `````````````````_₫¶¶¶¶¶¶¶¶¶₫`````````````````````````
  63. ````````````````````1¶¶¶¶¶¶¶¶¶¶₫``````````````````````
  64. ```````1₫§₫1``````````₫¶¶¶¶¶¶¶¶¶¶1```_₫1``````````````
  65. ```_§$$$¶¶¶¶¶¶¶¶₫_``````§¶¶¶¶¶¶¶¶¶¶1``₫$$1````````````
  66. ````````````₫¶¶¶¶¶¶§1````1¶¶¶¶¶¶¶¶¶¶1``1¶¶§_``````````
  67. `````1§§₫1`````₫¶¶¶¶¶¶₫````₫¶¶¶¶$$¶¶¶$``_¶¶$``````````
  68. ``````₫¶¶¶¶¶₫```1¶¶¶¶¶¶¶§`````````1¶¶¶$1`1¶¶$1````````
  69. ````````_$¶¶¶¶$_`1§¶¶¶¶¶¶¶$1_``````1¶¶¶¶11¶¶¶$````````
  70. ``````````1¶¶¶¶§```¶¶¶¶¶¶¶¶¶¶¶1````1¶¶¶¶¶¶¶¶¶¶1```````
  71. ```````````§¶¶¶¶§1_1$¶¶¶¶¶¶¶¶¶1```₫¶¶¶¶¶¶¶¶¶¶¶§1``````
  72. ````````````1§¶¶¶¶₫``````1¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶$1``````
  73. ````````````₫¶¶¶¶¶¶1```````1§¶¶¶¶¶¶¶¶¶¶§₫§¶¶¶¶¶₫``````
  74. ```````````$¶¶¶¶¶¶¶§``₫¶¶₫11§¶¶¶¶¶¶¶¶¶¶$1_1§¶¶¶§``````
  75. ````````````````₫¶¶¶₫`_$¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶§111$¶$``````
  76. `````₫§`````````_$¶¶¶11§¶¶¶¶¶¶¶¶¶¶¶¶¶¶$¶¶¶¶§1₫¶¶§`````
  77. `````$¶§````````1¶¶¶§11¶¶¶¶¶¶¶¶¶§₫§¶¶¶$₫$¶¶¶¶¶¶¶¶§````
  78. `````₫¶¶¶§1``_11$¶¶¶11₫¶¶¶¶¶§1_`````1§¶$11¶¶¶¶¶¶¶$1```
  79. ``_```₫¶¶¶¶¶¶¶¶¶¶¶$11$¶¶¶¶$1``````````§¶¶§₫§¶¶¶¶¶¶§_``
  80. `₫$1```₫¶¶¶¶¶¶¶¶¶¶$11§¶¶¶¶1````````````1¶$₫₫¶¶¶¶¶¶¶₫``
  81. `₫¶$1```1$¶¶¶¶¶¶¶¶¶§11₫¶¶¶1``````````````1¶¶$$¶¶¶¶$1``
  82. `_$¶¶1````1§¶¶¶¶¶¶¶¶₫_1$¶¶¶1``````````````₫§₫₫$¶¶¶§```
  83. ``1¶¶¶1`````₫¶¶¶¶¶¶¶¶$1`1§¶¶¶₫```````````````1¶¶¶¶_```
  84. ```₫¶¶¶$````_§¶¶¶¶¶¶¶¶¶₫11111₫11`````````````1¶¶§`````
  85. ````₫¶¶¶¶¶₫``1¶¶¶¶¶¶¶¶¶¶¶$§§§$¶¶§`````````````_```````
  86. `````1¶¶¶¶¶11§¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶1````````````````````
  87. ```````§¶¶¶§₫¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶§````````````````````
  88. ```$$```1₫§§$¶¶¶¶1_``1₫$¶¶¶¶¶¶¶¶¶¶1```````````````````
  89. ```§¶$1````§¶¶¶₫```````1$¶¶¶¶¶¶¶¶¶₫```````````````````
  90. ````§¶¶¶```₫¶¶¶````````1$¶¶¶¶¶¶¶¶¶¶§``````````````````
  91. `````$¶¶¶11$¶¶₫````````1$¶¶¶¶¶¶¶¶¶¶¶§`````````````````
  92. ``````₫¶¶¶¶¶¶§1```````1¶¶¶¶¶¶¶$₫1§¶¶¶§````````````````
  93. ```````1§¶¶¶$§₫````_$¶¶¶¶¶¶¶¶¶1```1¶¶¶₫```````````````
  94. ``````````11₫$₫````_§¶¶¶¶¶¶¶¶¶1```₫¶¶¶¶§``````````````
  95. ````````````_§§```````1¶¶¶¶¶¶¶$1``$¶¶¶¶¶₫`````````````
  96. ``````````````_````11_``1¶¶¶¶¶¶$``1¶¶¶¶¶§1````````````
  97. ````````````````````§¶₫``1$¶¶¶¶¶§``1$¶¶¶¶§````````````
  98. `````````````````````$¶¶1``1¶¶¶¶¶¶```§¶¶¶¶_```````````
  99. `````````````````````1¶¶¶1``1¶¶¶¶¶1```§¶¶¶1```````````
  100. `````````````````````1¶¶¶¶1``1¶¶¶¶¶1``1¶¶¶₫```````````
  101. ````````````````````1¶¶¶¶¶$1``₫¶¶¶¶¶_``1¶¶§_``````````
  102. ````````````````````1¶¶¶¶¶¶¶1`_$¶¶¶¶1```¶¶§```````````
  103. ``````````````````````₫¶¶¶¶¶₫``1$¶¶¶$_``¶¶₫```````````
  104. ```````````````````````₫¶¶¶¶$1``₫¶¶¶¶₫``$¶1```````````
  105. ````````````````````````₫¶¶¶¶$``1¶¶¶¶§``1§````````````
  106. ````````````````````````_$¶¶¶¶1``$¶¶¶$1``_````````````
  107. `````````````````````````₫¶¶¶¶1``§¶¶¶¶1```````````````
  108. `````````````````````````1$¶¶¶1``§¶¶¶$_```````````````
  109. ``````````````````````````§¶¶¶₫``₫¶¶¶$````````````````
  110. ``````````````````````````§¶¶¶1``§¶¶¶$````````````````
  111. ``````````````````````````§¶¶¶1`1¶¶¶¶§````````````````
  112. `````````````````````````1$¶¶¶1`1¶¶¶§1````````````````
  113. `````````````````````````₫¶¶¶₫``§¶¶¶₫`````````````````
  114. ````````````````````````1¶¶¶§``1¶¶¶§``````````````````
  115. ````````````````````````1¶¶¶1`1¶¶¶§```````````````````
  116. ```````````````````````_$¶¶$``₫¶¶¶_```````````````````
  117. ``````````````````````1$¶¶§_`₫¶¶§`````````````````````
  118. `````````````````````_$¶¶$``₫¶¶₫``````````````````````
  119. ````````````````````1¶¶¶$1`₫¶¶1```````````````````````
  120. ```````````````````₫¶¶¶§1`§¶§`````````````````````````
  121. ``````````````````§¶¶¶₫``₫§_``````````````````````````
  122. `````````````````§¶¶¶1````````````````````````````````
  123. ````````````````₫¶¶$1`````````````````````````````````
  124. ```````````````1¶¶¶```````````````````````````````````
  125. ``````````````_$¶§_```````````````````````````````````
  126. ``````````````₫¶¶`````````````````````````````````````
  127. ``````````````§$§`````````````````````````````````````
  128. `````````````1₫₫1`````````````````````````````````````
Add Comment
Please, Sign In to add comment