Tugas 8.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; // Nama : Ramdika Rovansah // Nim : 3420230027 void garis() { puts("============================================="); } void judul() { garis(); puts("\t Contoh Program Array"); garis(); } void author() { puts("Nama\t: Ramdika Rovansah"); puts("Email\t: ramdika33@gmail.com@gmail.com"); } int main() { int n, absen[100], tugas[100], uts[100], uas[100]; float total[100]; judul(); // Input jumlah data cout << "Masukan Jumlah Data:\n"; cin >> n; garis(); // Input data for (int i = 0; i < n; i++) { cout << "Data ke-" << i + 1 << endl; cout << "Masukan Nilai Absen\t : \n"; cin >> absen[i]; cout << "Masukan Nilai tugas\t : \n"; cin >> tugas[i]; cout << "Masukan Nilai UTS\t : \n"; cin >> uts[i]; cout << "Masukan Nilai UAS\t : \n"; cin >> uas[i]; total[i] = (float)(absen[i] *0.1)+(tugas[i] *0.2) + (uts[i] *0.3) + (uas[i] *0.4); garis(); } // Tampilkan data cout << "Data Yang Anda Masukan \t :\n"; garis(); cout << "No\tAbsen\tTugas\tUTS\tUAS\tTotal\n"; garis(); for (int i = 0; i < n; i++) { cout << i + 1 << "\t" << absen[i] << "\t" << tugas[i] << "\t"<< uts[i] << "\t" << uas[i] << "\t" << total[i] << ".00\n"; } garis(); author(); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines