#include <iostream>
#include <iomanip>
using namespace std;
int main() {
string nama, NIM;
float ips1, ips2, ips3, ipk;
cout << "Masukkan nama anda : ";
cin >> nama;
cout << "Masukkan NIM anda : ";
cin >> NIM;
cout << "Masukkan IP Semester 1 : ";
cin >> ips1;
cout << "Masukkan IP Semester 2 : ";
cin >> ips2;
cout << "Masukkan IP Semester 3 : ";
cin >> ips3;
cout << "===========================================================" << endl;
ipk = (ips1 + ips2 + ips3)/3;
cout << "Nama : " << nama << endl;
cout << "NIM : " << NIM << endl;
cout << setprecision(2) << "IPK kamu adalah : " << ipk << endl;
if(ips1 >= 0 && ips1 <= 4 && ips2 >= 0 && ips2 <= 4 && ips3 >= 0 && ips3 <= 4){
if(ips3 >= 3.0){
cout << "Semester berikutnya kamu dapat mengambil sks maksimal 24 sks.";
}else if(ips3 >= 2.0 && ips3 < 2.95){
cout << "Semester berikutnya kamu dapat mengambil sks maksimal 20 sks.";
}else {
cout << "Semester berikutnya kamu dapat mengambil sks maksimal 19 sks.";
}
}else{
cout << "Input yang anda masukkan tidak sesuai.";
}
return 0;
}
Replies to Tugas 2
Title |
Name |
Language |
UNIX |
When |
Re: Tugas 2 |
Trivial Marmoset |
cpp |
1632276155 |
2 Years ago. |
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}