Facebook
From Muhammad Fahmi Gymnnastiar G, 2 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 79
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6.         string nama, NIM;
  7.         float ips1, ips2, ips3, ipk;
  8.        
  9.         cout << "Masukkan nama anda : ";
  10.         cin >> nama;
  11.         cout << "Masukkan NIM anda : ";
  12.         cin >> NIM;
  13.         cout << "Masukkan IP Semester 1 : ";
  14.         cin >> ips1;
  15.         cout << "Masukkan IP Semester 2 : ";
  16.         cin >> ips2;
  17.         cout << "Masukkan IP Semester 3 : ";
  18.         cin >> ips3;
  19.         cout << "===========================================================" << endl;
  20.        
  21.         ipk = (ips1 + ips2 + ips3)/3;
  22.        
  23.         cout << "Nama : " << nama << endl;
  24.     cout << "NIM : " << NIM << endl;
  25.         cout << setprecision(2) << "IPK kamu adalah : " << ipk << endl;
  26.        
  27.         if(ips1 >= 0 && ips1 <= 4 && ips2 >= 0 && ips2 <= 4 && ips3 >= 0 && ips3 <= 4){
  28.         if(ips3 >= 3.0){
  29.             cout << "Semester berikutnya kamu dapat mengambil sks maksimal 24 sks.";
  30.         }else if(ips3 >= 2.0 && ips3 < 2.95){
  31.         cout << "Semester berikutnya kamu dapat mengambil sks maksimal 20 sks.";
  32.         }else {
  33.         cout << "Semester berikutnya kamu dapat mengambil sks maksimal 19 sks.";
  34.         }
  35.         }else{
  36.         cout << "Input yang anda masukkan tidak sesuai.";
  37.     }
  38.  
  39.         return 0;      
  40. }
  41.  
  42.