#include
#include
#include
void main()
{
int p,jum=0,i;
char ulang;
float data[10],rata;
do
{
cout<<"masukan banyak data =";
cin>>p;
for (i=1; i<=p; i++)
{
cout <<"masukkan data ke "< cin>>data[i];
jum=jum+data[i];
}
rata=jum/p;
cout<<"rata rata = "<
if(rata<=100&&rata>80)
{
cout<<"nilai anda = A"<
else if(rata<=80&&rata>70)
{
cout<<"nilai anda = B"<
else if (rata<=70&&rata>60)
{
cout<<"nilai anda = C"<
else if (rata<=60&&rata>50)
{
cout<<"nilai anda = D"<
else if (rata<=50)
{
cout<<"nilai anda = E"<
cout<<"apakah anda ingin mengulang? (y/t) "<
}
while(ulang=='y');
getch();
}
0 komentar:
Posting Komentar