Nilai akhir = (10%*nilai tugas) + (20%*nilai kuis) + (30%*nilai mid) + (40%*nilai uas)
Nilai huruf = Nilai akhir > 85 : A
85 >= nilai akhir > 70 : B
70 >= nilai akhir > 55 : C
55 >= nilai akhir > 40 : D
Sumber gambar : SDtimes
Inputan Data yang digunakan adalah nama mahasiswa, nim mahasiswa, matakuliah, nilai tugas, nilai kuis, nilai mid dan nilai uas.Program yang dibuat :
#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main(){
string a, b, c;
char kriteria;
float nilai_tugas,nilai_kuis, nilai_mid, nilai_uas, na;
cout << " Menghitung nilai akhir mahasiswa " << endl << endl;
cout << "Nama = "; cin>>a;
cout << "\nNim = "; cin>>b;
cout << "\nMata kuliah = "; cin>>c;
cout << "\nNilai tugas = "; cin >> nilai_tugas;
cout << "\nNilai kuis = " ; cin >> nilai_kuis;
cout << "\nNilai Mid = "; cin >> nilai_mid;
cout << "\nNilai Uas = "; cin >> nilai_uas;
nilai_tugas = nilai_tugas * 0.1;
nilai_kuis = nilai_kuis * 0.2;
nilai_mid = nilai_mid * 0.3;
nilai_uas = nilai_uas * 0.4;
na = nilai_tugas + nilai_kuis + nilai_mid + nilai_uas;
cout << endl;
cout << "Siswa yang bernama " << ">>" << a << " << " << endl;
cout << "\nNIM = " << b << endl;
cout << "\nMatakuliah = " << c << endl;
cout << "\nNilai tugas x 10% = " << nilai_tugas << endl;
cout << "\nNilai kuis x 20% = " << nilai_kuis << endl;
cout << "\nNilai mid x 30% = " << nilai_mid << endl;
cout << "\nNilai uas x 40% = " << nilai_uas << endl;
cout << "\nmemperoleh nilai akhir = " << na << endl;
cout << "\nDengan kriteria = " << kriteria;
if(na >= 85){
cout << "A";
}else if(na >= 80){
cout << "AB";
}else if(na >= 70){
cout << "B";
}else if(na >= 65){
cout << "BC";
}else if(na >= 55){
cout << "C";
}else if(na >= 40){
cout << "D";
}else{
cout << "E";
}
getch();
}
0 komentar: