Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ?? - Kalau nmpak tnda "//" atau "/* test */" tu maksudnya
- comment je yerr.
- ?? - Comment xdexecute oleh sistem.. so klau nk
- tulis sbgai peringatan masa hdapn blh je tpi ingat tau kena
- letak tnda palang 2 kali. e.g : // atau /**/
- -----------------------------------------------------------------------
- #include <iostream>
- using namespace std;
- int main()
- {
- int mark[5]; // klau nk fham apa fungsi [5] tu haaa. check notes dkat bhagian bwah skali tu yerr
- int i, sum = 0; // 'i' tu utk loop
- double avg; // guna "double" sbb avg majoriti dlm decimal num
- int student = 0; // student mesti equal to 0 dulu sbb kita just nak update je nanti
- for( i=0; i < 5; i++){
- // Ni loop yg pertama. Loop ni loop mcam biasa je.. cuma ade benda pelik sikit dekat bawah tu.. [i]. Loop ni utk
- // user input mark yg student dpt. Lpastu mark yg user input tu akn disimpan dlm variable mark.
- cout << "Enter the student mark : ";
- cin >> mark[i]; //haa ni kalau xtngok video from link yg saya bgi kat bawah tu mungkin pening skit apa benda [i] tuu :)
- sum = sum + mark[i];
- }
- avg = sum / 5.0; // dlm calculation avg kena divide by (5.0) ** kena dlm bentuk decimal. fhm2 lah
- for( i=0; i < 5; i++ ){
- if( mark[i] > avg ){ //Loop ke-2. Loop ni utk update bil student yg dpt mark > avg yg dh kita calculate dkat atas tu..
- student++;
- }
- }
- cout << "\nRESULT : ";
- cout << "\n" << student << " student get mark more than the average of quiz." << endl;
- return 0;
- }
- -----------------------------------------------------------------------
- N.O.T.E.S
- * mark[5] tu ialah Array. Array blum blajar lgi rasanya.. hmm.. Miss sje je ni nk kenakan kita lgi :'<
- * 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
- * Reference :
- - https://www.w3schools.com/
- - https://www.youtube.com/watch?v=vLnPwxZdW4Y
- - Klau xfhm pape pm je.
- -----------------------------------------------------------------------
- ```````_1111111_``````````````````````````````````````
- ```1$¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶$₫_```````````````````````````````
- `_111_```````1₫$¶¶¶¶¶¶¶¶¶₫_```````````````````````````
- `````````````````_₫¶¶¶¶¶¶¶¶¶₫`````````````````````````
- ````````````````````1¶¶¶¶¶¶¶¶¶¶₫``````````````````````
- ```````1₫§₫1``````````₫¶¶¶¶¶¶¶¶¶¶1```_₫1``````````````
- ```_§$$$¶¶¶¶¶¶¶¶₫_``````§¶¶¶¶¶¶¶¶¶¶1``₫$$1````````````
- ````````````₫¶¶¶¶¶¶§1````1¶¶¶¶¶¶¶¶¶¶1``1¶¶§_``````````
- `````1§§₫1`````₫¶¶¶¶¶¶₫````₫¶¶¶¶$$¶¶¶$``_¶¶$``````````
- ``````₫¶¶¶¶¶₫```1¶¶¶¶¶¶¶§`````````1¶¶¶$1`1¶¶$1````````
- ````````_$¶¶¶¶$_`1§¶¶¶¶¶¶¶$1_``````1¶¶¶¶11¶¶¶$````````
- ``````````1¶¶¶¶§```¶¶¶¶¶¶¶¶¶¶¶1````1¶¶¶¶¶¶¶¶¶¶1```````
- ```````````§¶¶¶¶§1_1$¶¶¶¶¶¶¶¶¶1```₫¶¶¶¶¶¶¶¶¶¶¶§1``````
- ````````````1§¶¶¶¶₫``````1¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶$1``````
- ````````````₫¶¶¶¶¶¶1```````1§¶¶¶¶¶¶¶¶¶¶§₫§¶¶¶¶¶₫``````
- ```````````$¶¶¶¶¶¶¶§``₫¶¶₫11§¶¶¶¶¶¶¶¶¶¶$1_1§¶¶¶§``````
- ````````````````₫¶¶¶₫`_$¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶§111$¶$``````
- `````₫§`````````_$¶¶¶11§¶¶¶¶¶¶¶¶¶¶¶¶¶¶$¶¶¶¶§1₫¶¶§`````
- `````$¶§````````1¶¶¶§11¶¶¶¶¶¶¶¶¶§₫§¶¶¶$₫$¶¶¶¶¶¶¶¶§````
- `````₫¶¶¶§1``_11$¶¶¶11₫¶¶¶¶¶§1_`````1§¶$11¶¶¶¶¶¶¶$1```
- ``_```₫¶¶¶¶¶¶¶¶¶¶¶$11$¶¶¶¶$1``````````§¶¶§₫§¶¶¶¶¶¶§_``
- `₫$1```₫¶¶¶¶¶¶¶¶¶¶$11§¶¶¶¶1````````````1¶$₫₫¶¶¶¶¶¶¶₫``
- `₫¶$1```1$¶¶¶¶¶¶¶¶¶§11₫¶¶¶1``````````````1¶¶$$¶¶¶¶$1``
- `_$¶¶1````1§¶¶¶¶¶¶¶¶₫_1$¶¶¶1``````````````₫§₫₫$¶¶¶§```
- ``1¶¶¶1`````₫¶¶¶¶¶¶¶¶$1`1§¶¶¶₫```````````````1¶¶¶¶_```
- ```₫¶¶¶$````_§¶¶¶¶¶¶¶¶¶₫11111₫11`````````````1¶¶§`````
- ````₫¶¶¶¶¶₫``1¶¶¶¶¶¶¶¶¶¶¶$§§§$¶¶§`````````````_```````
- `````1¶¶¶¶¶11§¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶1````````````````````
- ```````§¶¶¶§₫¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶§````````````````````
- ```$$```1₫§§$¶¶¶¶1_``1₫$¶¶¶¶¶¶¶¶¶¶1```````````````````
- ```§¶$1````§¶¶¶₫```````1$¶¶¶¶¶¶¶¶¶₫```````````````````
- ````§¶¶¶```₫¶¶¶````````1$¶¶¶¶¶¶¶¶¶¶§``````````````````
- `````$¶¶¶11$¶¶₫````````1$¶¶¶¶¶¶¶¶¶¶¶§`````````````````
- ``````₫¶¶¶¶¶¶§1```````1¶¶¶¶¶¶¶$₫1§¶¶¶§````````````````
- ```````1§¶¶¶$§₫````_$¶¶¶¶¶¶¶¶¶1```1¶¶¶₫```````````````
- ``````````11₫$₫````_§¶¶¶¶¶¶¶¶¶1```₫¶¶¶¶§``````````````
- ````````````_§§```````1¶¶¶¶¶¶¶$1``$¶¶¶¶¶₫`````````````
- ``````````````_````11_``1¶¶¶¶¶¶$``1¶¶¶¶¶§1````````````
- ````````````````````§¶₫``1$¶¶¶¶¶§``1$¶¶¶¶§````````````
- `````````````````````$¶¶1``1¶¶¶¶¶¶```§¶¶¶¶_```````````
- `````````````````````1¶¶¶1``1¶¶¶¶¶1```§¶¶¶1```````````
- `````````````````````1¶¶¶¶1``1¶¶¶¶¶1``1¶¶¶₫```````````
- ````````````````````1¶¶¶¶¶$1``₫¶¶¶¶¶_``1¶¶§_``````````
- ````````````````````1¶¶¶¶¶¶¶1`_$¶¶¶¶1```¶¶§```````````
- ``````````````````````₫¶¶¶¶¶₫``1$¶¶¶$_``¶¶₫```````````
- ```````````````````````₫¶¶¶¶$1``₫¶¶¶¶₫``$¶1```````````
- ````````````````````````₫¶¶¶¶$``1¶¶¶¶§``1§````````````
- ````````````````````````_$¶¶¶¶1``$¶¶¶$1``_````````````
- `````````````````````````₫¶¶¶¶1``§¶¶¶¶1```````````````
- `````````````````````````1$¶¶¶1``§¶¶¶$_```````````````
- ``````````````````````````§¶¶¶₫``₫¶¶¶$````````````````
- ``````````````````````````§¶¶¶1``§¶¶¶$````````````````
- ``````````````````````````§¶¶¶1`1¶¶¶¶§````````````````
- `````````````````````````1$¶¶¶1`1¶¶¶§1````````````````
- `````````````````````````₫¶¶¶₫``§¶¶¶₫`````````````````
- ````````````````````````1¶¶¶§``1¶¶¶§``````````````````
- ````````````````````````1¶¶¶1`1¶¶¶§```````````````````
- ```````````````````````_$¶¶$``₫¶¶¶_```````````````````
- ``````````````````````1$¶¶§_`₫¶¶§`````````````````````
- `````````````````````_$¶¶$``₫¶¶₫``````````````````````
- ````````````````````1¶¶¶$1`₫¶¶1```````````````````````
- ```````````````````₫¶¶¶§1`§¶§`````````````````````````
- ``````````````````§¶¶¶₫``₫§_``````````````````````````
- `````````````````§¶¶¶1````````````````````````````````
- ````````````````₫¶¶$1`````````````````````````````````
- ```````````````1¶¶¶```````````````````````````````````
- ``````````````_$¶§_```````````````````````````````````
- ``````````````₫¶¶`````````````````````````````````````
- ``````````````§$§`````````````````````````````````````
- `````````````1₫₫1`````````````````````````````````````
Add Comment
Please, Sign In to add comment