#include <iostream>
using namespace std;
//Nama : Moh.Faqih S.Karim
//NIM : 3420230034
void garis() {
puts("===========================================");
}
void judul() {
garis(); puts("\t Contoh Program Array"); garis();
}
void nama() {
puts("Nama\t: Moh.Faqih S.Karim");
puts("Email\t: muhammadfaqih1434@gamil.com");
}
int main() {
int i,data;
judul();
printf("Masukan Jumlah Data\t: "); cin>>data; cout<<endl;
int absen[5], tugas[5], uts[5], uas[5];
float total[5];
for(i=1;i<=data;i++) {
garis();
printf("Data ke-%d \n", i);
printf("Masukan Nilai Absen\t:\n"); scanf("%d",&absen[i]);
printf("Masukan Nilai Tugas\t:\n"); scanf("%d",&tugas[i]);
printf("Masukan Nilai UTS\t:\n"); scanf("%d",&uts[i]);
printf("Masukan Nilai UAS\t:\n"); scanf("%d",&uas[i]);
total[i] = (absen[i] * 0.1) + (tugas[i] * 0.2) + (uts[i] * 0.3) + (uas[i] * 0.4);
}
garis();
puts("Data Yang Anda Masukan");
garis();
puts("No Absen Quis UTS UAS Total");
garis();
for(i=1;i<=data;i++) {
printf("%d %d %d %d %d %.2f \n", i, absen[i], tugas[i], uts[i], uas[i], total[i]);
}
garis();
nama();
return 0;
}