#include <iostream>
using namespace std;
//nama : la ode ian
//nim : 3420210002
//prodi: Teknik informatika
void garis() {
puts("==================================================");
}
void judul() {
garis(); puts("\t Contoh Program Array"); garis();
}
void author() {
puts("Nama \t: la ode ian");
puts("Email\t: laodeian@gmail.com");
}
int main() {
int jml;
judul();
cout << "Masukan Jumlah Data : "; cin >> jml; cout << endl;
// Deklarasi array
int absen[jml], tugas[jml], uts[jml], uas[jml];
float total[jml];
// Input data
for (int i = 0; i < jml; i++) {
garis();
cout << "Data ke-" << i + 1 << endl;
cout << "Masukan Nilai Absen : "<<endl; cin >> absen[i];
cout << "Masukan Nilai Tugas : "<<endl; cin >> tugas[i];
cout << "Masukan Nilai UTS : "<<endl; cin >> uts[i];
cout << "Masukan Nilai UAS : "<<endl; cin >> uas[i];
total[i] = (absen[i] * 0.1) + (tugas[i] * 0.2) + (uts[i] * 0.3) + (uas[i] * 0.4);
}
garis();
printf ("Data Yang Anda Masukan\n");
garis();
printf("No Absen Tugas UTS UAS Total\n");
garis();
for (int i = 0; i < jml; i++) {
cout << i + 1 << " ";
cout << absen[i] << " ";
cout << tugas[i] << " ";
cout << uts[i] << " ";
cout << uas[i] << " ";
cout << total[i] << endl;
}
garis();
author();
return 0;
}