66 struct student { 67 char name [20]: 68 int8 t data [8] I/ skip if data--128 6
ID: 3760156 • Letter: 6
Question
66 struct student { 67 char name [20]: 68 int8 t data [8] I/ skip if data--128 69 L 70 typedef struct student student_t; 71 73 Finds the average student grade 74 Skip grades that are -128 75 Input: one student record 76 Error conditions: Return-128 if there are no grades in the 1ist. 77 Test cases 78 79 80 81 82 83 * / 84 Eint8 t Grade (student t s){ 85 / put your code here 86 87 "Jony". { 100, 100, 100, 100,-128,-128,-128,-128} //Grade=100 "Ramesh", 90, 90, 90, 90,-128, 90,-128, 90 //Grade-90 "Mattan", t 95, 100, 95, 90,-128, 80,-128, 110 //Grade-95 "Noosek". { 110, 100, 100, 100, 100, 98, 100, 100} //Grade=101 {-128,-128,-128,-128,-128,-128,-128,-128} //Grade=-128 int i 0; int 3um 0; int avg 0; 89 90 for (i=0; iExplanation / Answer
if (s.data[i] != -128)
{
sum = s.data[i]+sum;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.