Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int UTS, UAS, TUGAS;
- string NILAI_UTS, NILAI_UAS, NILAI_TUGAS;
- cout << "Nilai UTS : "; cin >> UTS;
- cout << "Nilai UAS : "; cin >> UAS;
- cout << "Nilai Tugas : "; cin >> TUGAS;
- if(UTS == 0 || UAS == 0 || TUGAS == 0){
- cout << "Nilai UTS : E, Nilai UAS : E, Nilai Tugas : E" << endl;
- }else{
- if(UTS >= 75 && UTS <= 100){
- NILAI_UTS = "A";
- }else if(UTS >= 60 && UTS<= 75){
- NILAI_UTS = "B";
- }else if(UTS >= 40 && UTS<= 60){
- NILAI_UTS = "C";
- }else if(UTS >= 20 && UTS<= 40){
- NILAI_UTS = "D";
- }else{
- NILAI_UTS = "E";
- }
- if(UAS >= 75 && UAS <= 100){
- NILAI_UAS = "A";
- }else if(UAS >= 60 && UAS <= 75){
- NILAI_UAS = "B";
- }else if(UAS >= 40 && UAS <= 60){
- NILAI_UAS = "C";
- }else if(UAS >= 20 && UAS <= 40){
- NILAI_UAS = "D";
- }else{
- NILAI_UAS = "E";
- }
- if(TUGAS >= 75 && TUGAS <= 100){
- NILAI_TUGAS = "A";
- }else if(TUGAS >= 60 && TUGAS <= 75){
- NILAI_TUGAS = "B";
- }else if(TUGAS >= 40 && TUGAS <= 60){
- NILAI_TUGAS = "C";
- }else if(TUGAS >= 20 && TUGAS <= 40){
- NILAI_TUGAS = "D";
- }else{
- NILAI_TUGAS = "E";
- }
- cout << "Nilai UTS : " << NILAI_UTS << ", Nilai UAS : " << NILAI_UAS << ", Nilai Tugas : " << NILAI_TUGAS << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement