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
1 1
2 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()

{

..

}

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!