at the end of this program we have to add the average of all the students* add and divide by 3* also put a ** next to student who have over 95 % both thses should be displayed at the end
so ANYONE dare to try
#include <stdio.h>
#include <math.h>
/* AUTHOR :: your name here */
struct student
{
long id;
char name[26];
float assignment;
float quiz1;
float quiz2;
};
void main(void)
{
struct student st[5];
int x=0;
double dummy = sin(0.0); //goodwin patch here!
double d = dummy;
dummy=d;
for (x=0; x<5; x++)
{
printf("\nPlease input ID (or a zero to quit) : ");
scanf("%ld", &st[x].id);
if (st[x].id == 0)
break;
while (getchar() != '\n') //goodwin patch here!
continue;
printf("\nplease input name: ");
gets(st[x].name);
printf("\nPlease input assignment grade: ");
scanf("%f", &st[x].assignment);
printf("\nPlease input Quiz 1 grade: ");
scanf("%f", &st[x].quiz1);
printf("\nPlease input Quiz 2 grade: ");
scanf("%f", &st[x].quiz2);
}
printf("\n ID \t NAME \t AVERAGE");
printf("\n------------------------------\n");
for (x=0; x<25; x++)
{
if (st[x].id == 0)
break;
printf("\n %ld ", st[x].id);
printf("\t %s ", st[x].name);
printf("\t %.1f ", st[x].assignment); //print average instead and *** when >95