akbarbasya26

praktek2b

Mar 8th, 2020
147
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. using namespace std;
  3. main ()
  4. {
  5. int opsi;
  6. printf ("MENU : \n\t1. HITUNG KELULUSAN \n\t2. HITUNG VOLUME BALOK\n");
  7. printf ("pilih opsi :"); scanf ("%d", &opsi);
  8. switch (opsi){
  9. case 1 :
  10. float total, kuis, praktek, UAS;
  11. printf("Masukan kuis : "); scanf("%f", &kuis );
  12. printf("Masukan praktek : "); scanf("%f", &praktek );
  13. printf("Masukan UAS : "); scanf("%f", &UAS );
  14. total = (kuis + praktek + UAS )/3;
  15.  
  16. if (total >80){
  17. printf ("Lulus");
  18. }else if (total >60){
  19. printf ("Mengulang");
  20. }else{
  21. printf ("Tidak Lulus");
  22. }
  23. break;
  24. case 2 :
  25. int nilai, panjang, lebar, tinggi;
  26. printf("panjang: "); scanf ("%d", &panjang);
  27. printf("lebar: "); scanf ("%d", &lebar);
  28. printf("tinggi: "); scanf ("%d", &tinggi);
  29. nilai = (panjang * lebar * tinggi);
  30. printf("Nilai volume balok : %d", nilai);
  31. break;
  32. }
  33.  
  34.  
  35.  
  36. }
RAW Paste Data