+ 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

25th May 2019, 1:51 PM
seraj aldean
seraj aldean - avatar
1 Resposta
+ 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.
26th May 2019, 3:46 PM
Komodo64
Komodo64 - avatar