Tugas2.2

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <iomanip> // Muhammad Irfan Zidni // 3420230014 // Tekhnik Informatika using namespace std; int main() { double nilai_absen, nilai_tugas, nilai_uts, nilai_uas; double total_nilai; // Input the scores cout << "----------------------------------------" << endl; cout << "Program Menghitung Nilai Akhir" << endl; cout << "----------------------------------------" << endl; cout << "Masukan nilai Absen (10%) : \n"; cin >> nilai_absen; cout << "Masukan nilai Tugas (20%) : \n"; cin >> nilai_tugas; cout << "Masukan nilai UTS (30%) : \n"; cin >> nilai_uts; cout << "Masukan nilai UAS (40%) : \n"; cin >> nilai_uas; // Calculate the total grade total_nilai = (nilai_absen * 0.10) + (nilai_tugas * 0.20) + (nilai_uts * 0.30) + (nilai_uas * 0.40); // Output the total grade cout << "----------------------------------------" << endl; cout << "Nilai Total adalah : " << fixed << setprecision(2) << total_nilai << endl; cout << "----------------------------------------" << endl; return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines