// Online C compiler to run C program online
#include <stdio.h>
int main() {
// Write C code here
float nilai[5];
const char*mapel[]={"pjok", "seni budaya", "mtk", "bhs","bi"};
int i;
float rata = 0;
float kehadiran;
for(i=0;i<5;i++){
printf("masukkan nilai %s", mapel[i]);
scanf("%f", &nilai[i]);
}
printf("kehadiran (dalam bentuk %%) : ");
scanf("%f", &kehadiran);
if(kehadiran>80){
for(i=0;i<5;i++){
nilai[i]+=5;
}
} else if (kehadiran >= 60 && kehadiran <=79 ){
for(i=0;i<5;i++){
nilai[i]+=3;
}
}
for(i=0;i<5;i++){
rata+=nilai[i];
}
rata/=5;
printf("%.2f", rata);
return 0;
}