#include <iostream>
#include <iomanip>
using namespace std;
// void garis
void garis() {
puts("=========================================");
}
// void judul
void judul() {
garis();
puts("\tContoh Program Array");
garis();
}
// void author
void author() {
puts("Nama\t: Zacky Ahmad S");
puts("Email\t: zackyahmadsyahputra4@gmail.com");
}
int main() {
int jml;
judul();
printf("Masukan Jumlah Data\t: "); cin >> jml; cout << endl;
int absen[10], quis[10], tugas[10], uts[10], uas[10], total[10];
for (int i = 1; i <= jml; i++) {
garis();
printf("Data ke-%d\n", i);
printf("Masukan Nilai Absen\t: "); cin >> absen[i];
printf("\nMasukan Nilai Tugas\t: "); cin >> quis[i];
printf("\nMasukan Nilai UTS\t: "); cin >> uts[i];
printf("\nMasukan Nilai UAS\t: "); cin >> uas[i];
cout<< endl;
total[i] = absen[i] + quis[i] + uts[i] + uas[i];
}
garis();
puts("Data Yang Anda Masukan");
garis();
printf("No Absen Quis UTS UAS Total\n");
garis();
for (int i = 1; i <= jml; i++) {
printf("%-3d %-6d %-5d %-4d %-4d %.2f\n",
i,
absen[i],
quis[i],
uts[i],
uas[i],
total[i] / 4.0);
}
garis();
author();
return 0;
}