Once the user exits, the system will write the student array in ascending order in a file called ascending.txt together with the graph.
so i do this for the graph...
...
void fta(int);
void ftb(int);
void ftc(int);
void ftd(int);
void main (void)
{
int a=0;
int b=0;
int c=0;
int d=0;
for(x=0;x<size;x++)
{
if(std[x].avrg>80)
a=a+1;
else if(std[x].avrg>60)
b=b+1;
else if(std[x].avrg>40)
c=c+1;
else
d=d+1;
}
printf("\n");
printf("\tGrade A:%d",a); printf("\n");
printf("\tGrade B:%d",b); printf("\n");
printf("\tGrade C:%d",c); printf("\n");
printf("\tGrade D:%d",d); printf("\n");
printf("\n");printf("\n");
printf("\tA:");fta(a);printf("\n");
printf("\tB:");fta(b);printf("\n");
printf("\tC:");fta(c);printf("\n");
printf("\tD:");fta(d);printf("\n");
}
void fta(int a)
{
int x;
for(x=0;x<a;x++)
printf("#");
}
void ftb(int b)
{
int x;
for(x=0;x<b;x++)
printf("#");
}
void ftc(int c)
{
int x;
for(x=0;x<c;x++)
printf("#");
}
void ftd(int d)
{
int x;
for(x=0;x<d;x++)
printf("#");
}
the problem is, i need to send this graph into a note file...
how,how,how...
and, also need help regarding the "array in ascending order"... example maybe...:confused:
Edited by John, 29 October 2009 - 10:19 AM.
Use [CODE] tags when posting code.


Sign In
Create Account

Back to top









