+ 1
write aprogram that calculates average mark of female students in class assume that the last valu read is Sentinel -1 from mark
Can some help me to understand and solve this
1 Odpowiedź
+ 4
Assume you have an array 'marks' of size 'numstudents' which stores the marks of all students & where the last value in the array is -1.
Since you want the sum of all marks, you'd want to go through each mark in the array using a loop and add them to your sum variable.
Once you have the sum, you can easily get the average number by dividing the sum by 'numstudents'.
Hopefully, you'll now have an idea of how to do it.