hello,,,,
I want to explain for you about program C++,,,
this is program a calculate RERATA, PREDICATE, AND EXPLAINATION, about UAS, TASK, and UTS,,
this program useing code block,,
oke,,, good night,,
#include <iostream>
#include <string.h>
#include<stdio.h>
#include<conio.h>
using namespace std;
int main()
{
char nama[20],name[20][20],predikat[20];
char keterangan[20][20];
float uts[20],tugas[20],uas[20];
float rata[20];
int i=0,n;
cout<<"=====================================\n";
cout<<"menghitung nilai akhir\n";
cout<<"TUGAS 40%, UTS 30%, UAS 30%\n";
cout<<"untuk mengakhiri memasukan angka tekan huruf S(selesai)\n";
cout<<"dibuat oleh Agus Setiawan\n";
cout<<"=====================================\n";
mulai:
i+=1;
cout<<"masukan nama siswa ke "<<i<<":";
cin>>nama;
strcpy(name[i],nama);
if(strcmp(name[i],"s")==0||strcmp(name[i],"S")==0)
goto hitung;
cout<<"masukan nilai tugas:";
cin>>tugas[i];
cout<<"masukan nilai UTS:";
cin>>uts[i];
cout<<"masukan nilai UAS:";
cin>>uas[i];
goto mulai;
hitung:
cout<<endl;
cout<<"| NO | NAMA | TUGAS | UTS | UAS |RERATA|PREDIKAT| KETERANGAN |\n";
n=i;
for(i=1; i<n; i++)
{
rata[i]=(tugas[i]*0.4)+(uts[i]*0.3)+(uas[i]*0.3);
if(rata[i]>=55)
{
predikat[i]='D';
char ket[11]="KURANG";
strcpy(keterangan[i],ket);
}
if(rata[i]>=65)
{
predikat[i]='C';
char ket[11]="CUKUP";
strcpy(keterangan[i],ket);
}
if(rata[i]>=75)
{
predikat[i]='B';
char ket[11]="BAIK";
strcpy(keterangan[i],ket);
}
if(rata[i]>=85)
{
predikat[i]='A';
char ket[12]="BAIK SEKALI";
strcpy(keterangan[i],ket);
}
if(rata[i]<55)
{
predikat[i]='E';
char ket[15]="SANGAT KURANG";
strcpy(keterangan[i],ket);
}
cout<<" "<<i<<" \t"<<name[i]<<"\t\t "<<tugas[i]<<" \t"<<uts[i]<<" \t"<<uas[i]<<"\t"<<rata[i]<<"\t"<<predikat[i]<<"\t"<< keterangan[i]<<endl;
}
return 0;
}