Try to code on my pad lol
This commit is contained in:
parent
53b7792b4e
commit
5dee97aa6e
|
@ -110,7 +110,7 @@ void update(char *id, int *scores, STUDENT *students, int size) { // 3
|
|||
int loc = match(id, students, size);
|
||||
if (loc == -1) {
|
||||
printf("Students do not exist\n");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the student
|
||||
|
@ -124,13 +124,13 @@ void display(char *id, STUDENT *students, int size) { // 4
|
|||
int loc = match(id, students, size);
|
||||
if (loc == -1) {
|
||||
printf("Students do not exist\n");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// Display the average score
|
||||
int sum = 0;
|
||||
for (int i = 0; i < CLASS; i++) {
|
||||
/* printf("score[%d]: %d\n", i, students[loc].scores[i]); */
|
||||
/* printf("score[%d]: %d\n", i, students[loc].scores[i]); */
|
||||
sum += students[loc].scores[i];
|
||||
}
|
||||
printf("Student ID:%s\nName:%s\nAverage Score:%.1f\n", id, students[loc].name,
|
||||
|
|
Loading…
Reference in a new issue