#include<stdio.h>
#include<conio.h>
#include<string.h>
#define max 30
void Cal_semester_Grade(char studname[][25],int gradeavg[max],int examavg[max]);
void Class_Grade(char studname[][25],char classname[5],int classgrd[max][3],int gradeavg[max], int Maxtestscr[][3],char subject[15]);
void Exam_Grade(char studname[][25],char classname[5],char subjectname[15],int examavg[max],int Maxtestscr[max][3],int examgrd[max][3]);
void Search_name(char);
void Menu();
char studname[max][25];
int gradeavg[max];
int classgrd[max][3];
int examgrd[max][3]
int semesteravg[max];
char classname[5];
char subjectname[15];
int examavg[max];
int Maxtestscr[max][3];
int main(void)
{
int choice,i,y,d;
{
Menu();
printf("Please enter choice");
scanf("%d",&choice);
switch (choice)
{
case 1:
for(i=0;i<max;i++)
{
printf("\n Please enter students name:");
scanf("%s",&studname[i]);
printf("\n Please enter students class name:");
scanf("%s",&classname[i]);
printf("\n Please enter subject name:");
scanf("%s",&subjectname[i]);
printf("\n Please enter Class grade:");
scanf("%s",&classgrd[i]);
Class_Grade( studname,classname,classgrd,gradeavg,Maxtestscr,subjectname);
}
break;
case 2:
for(y=0;y<max;y++)
{
printf("\n Please enter students name:");
scanf("%s",&studname[y]);
printf("\n Please enter students class name:");
scanf("%s",&classname[y]);
printf("\n Please enter subject name:");
scanf("%s",&subjectname[y]);
printf("\n Please enter exam grade:");
scanf("%s",&examgrd[y]);
Exam_Grade(studname,classname,subjectname,examavg,Maxtestscr,examgrd);
break;
case 3:
for(d=0;d<max;d++)
{
printf("\n Please enter students name:");
scanf("%s",&studname[d]);
printf("\n Please Exam Average:");
scanf("%s",&examavg[d]);
printf("\n Please enter Grade Average:");
scanf("%s",&gradeavg[i]);
Cal_semester_Grade(studname,gradeavg,examavg);
break;
case 4:Menu();
default:
printf("You have entered an ivalid choice");
}
getch();
return 0;
}
void Menu()
{
printf("**************WELCOME TO MAIN MENU*************");
printf("\n1.Calculate class grade");
printf("\n2.Calculate Exam grade");
printf("\n3.Calculate semester grade");
printf("\n4.Enter Student's Name to Search");
printf("\n5.5Return to Main Menu");
getch();
}
void Class_Grade(char studname[][25],char classname[5], int classgrd[max][3],int gradeavg[max], int Maxtestscr[][3],char subject [15])
{
for(int a=0;a<max;a++)
{
for(int z=0; z<3;z++)
{
gradeavg[z]=classgrd[a][z]/Maxtestscr[a][z];
}
}
}
void Exam_Grade(char studname[][25],char classname[5],char subject [15],char examavg[max],int Maxtestscr[max][3],int examgrd[max][3];
{
for(int b=0;b<max;b++)
{
for(int c=0; c<3;c++)
{
examavg[c]=examgrd[b][c]/Maxtestscr[b][c];
}
}
}
void Cal_semester_Grade(char studname[][25],int gradeavg[max],int examavg[max]);
{
for(int e=0;e<max;e++)
{
for(int f=0; f<1;f++)
{
semesteravg[f]=(examavg[e][f]+gradeavg[e][f])/2;
}
}
void Search_name(char);
getch ();
}}
}}
DJInsane 16 Newbie Poster
tux4life 2,072 Postaholic
DJInsane 16 Newbie Poster
tux4life 2,072 Postaholic
DJInsane 16 Newbie Poster
tux4life 2,072 Postaholic
DJInsane 16 Newbie Poster
tux4life 2,072 Postaholic
DJInsane 16 Newbie Poster
jephthah 1,888 Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.