Question: 1) In this question, write a function evaluate() and do the necessary evaluation. Question: To decide the final result of two football teams , following

1) In this question, write a function evaluate() and do the necessary evaluation. Question: To decide the final result of two football teams , following data is taken from the monitor. First read the names of each team from the monitor and than get the goals of matches from the monitor until EOF. Fenerbahce Galatasaray 3 2 2 1 1 2 0 1 1 1 .. .. .. .. EOF To find the final scores, following process must be done for each match. If first team wins the game, first team gains two points, If second team wins the game than second team gains three points. If both goals are equal than both team gains one points. Using simple variable write a C program and function evaluate() and determine the final points of each team. If the final points are same than check total number of goals of each team and identify and list the names and total points and total goals of both teams and identify the final winner as Better Team Define your solution structure as follows. void eval(int, int, int *, int *); // prototype int main() { char namFb[12],nameGs[12]; int g1, g2, tg1 = 0,tg2 = 0, pt1 = 0,pt2 = 0; scanf(%s%s ,nameFb, nameGs); while(scanf(%d%d ,&g1,&g2) != EOF) { tg1+=g1; tg2+=g2; evaluate(g1 , g2 , &pt1, &pt2); } . // Chech points and if total goals are equal or not . } void eval() { .. } 2) The following programs can be used for self-studying for linked list insertion sort operation: #include #include #include #define NULL 0 struct node { char info[10]; struct node *n;// link field }; int main(void) { typedef struct node *NODEPTR; char a[10]; int cnt=0; NODEPTR x , y , save , head , p , q; x = (NODEPTR)malloc(sizeof(struct node)); y = (NODEPTR)malloc(sizeof(struct node)); head = x; x->n = y; y->n = NULL; strcpy(x->info,"cemal"); strcpy(y->info,"mert"); do { puts("Enter Name information(Using lover case character)"); gets(a); cnt++; q = NULL; for(p = head; p != NULL && strcmp(a, p->info)>0; p = p->n) q = p; if (q == NULL) { p=(NODEPTR)malloc(sizeof(struct node)); strcpy(p->info,a); p->n = head; head = p; } else { save=p; p = (NODEPTR)malloc(sizeof(struct node)); strcpy(p->info,a); p->n = save; q->n = p; } }while (cnt!=3); for(save = head;save != NULL;save = save->n) printf("Traverse Node =%s ",save->info); getchar(); } 3)Complete above program in a way that will delete any given person(name will be taken from the keyboard) from the linked list structure. List content of linked list after deletion. Note: Give error message if the given person is not in the linked list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!