Need help with assignment

Automation electronics
john 85 79
Sam 71 85
Clinton 50 65
Harry 89 77
Tom 74 69

When 1 is pressed it displays the name and scores of the students in descending order for electronics.
When 2 is pressed it displays the name and scores of the students in descending order for Automation.
when 3 is pressed it displays the average scores of the students for both subject in descending order.
[code]#include
void main()
{
char name[5],[10]; john,Sam,Clinton,Harry row, column;
unsigned int Automation, 79,85,65,77,69,row, column;
unsigned int Electronics, 85,71,50,89,74,row, column;
int choice 1,choice 2,choice3
double avg 1 = 0; avg 2 = 0;
for(count=0; count<5; count=count+1)
{
printf(Choice 1:"name and mark for electronic
");
scanf("%s %d %d", name, &mark1, &mark2);
total = total + mark1 + mark2;

printf(Choice 2:"name and mark for automation
");
scanf("%s %d %d", name, &mark1, &mark2);
total = total + mark1 + mark2;

printf(Choice 3:"Average Scores for students
");
scanf("%s %d %d", name, &mark1, &mark2);
total = total + mark1 + mark2;
total 1 = mark1;
total 2 = mark2;
}

}


}[/code]

Please Advice on my work and correct my mistakes as i started programming not long ago and this is my first assignment. Thanks, i cant seem to fix the errors and find out my mistakes

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories