Tugas2.2

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; //Nama: Fara Novri Hasbel Wijaya //NIM: 3420230017 int main() { //Variabel int absen, tugas, uts, uas; float total; printf("========================================="); cout << (" ") << endl; printf("=== Program Menghitung Nilai Akhir ==="); cout << (" ") << endl; printf("========================================="); cout << (" ") << endl; //Input nilai printf("Masukan Nilai Kehadiran (10%) :"); scanf("%d", &absen); cout << (" ") << endl; printf("Masukan Nilai Tugas (20%) :"); scanf("%d", &tugas); cout << (" ") << endl; printf("Masukan Nilai UTS (30%) :"); scanf("%d", &uts); cout << (" ") << endl; printf("Masukan Nilai UAS (40%) :"); scanf("%d", &uas); cout << (" ") << endl; //Menghitung nilai akhir total = (absen * 0.1) + (tugas * 0.2) + (uts * 0.3) + (uas * 0.4); //Hasil printf("========================================="); cout << (" ") << endl; printf("Nilai akhir adalah : %.2f\n", total); printf("========================================="); cout << (" ") << endl; printf("***** Belajarlah Dengan Niat *****", total); cout << (" ") << endl; printf("========================================="); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines