ANY ONE WHO CAN PLEASE HELP........
Design and write a C++ program for the problem given below. Apply the rules of good programming style by making your program modular, and using parameters and local variables in subprograms or functions. Add comments where necessary for each function. Use meaningful variable names. Your program should be user friendly.
A grade 12 class wrote a test in information technology which counted 50 marks. Their teacher wants to find out how many pupils got a mark between 0 and 49 percent (i.e. how many pupils failed), and how many got a mark of 50 percent and more (i.e. how many pupils passed the test). He also wants to determine the average mark of those who failed and the average mark of those who passed. Your task is to write a C++ program to do this. The marks should be entered until -999 is typed in and at the end the two totals calculated as well as the two averages have to displayed.
Your program should make use of the following 3 functions to solve the problem:
readInput( ): In this function, the end-user(teacher) should be prompted for a mark to be entered. After the mark has been captured it should be send back to the calling function, namely main( )
calculateTotals( ): Calculates the totals up to that point. In this function the mark that has just been read in, must be investigated to see which totals should be updated. It will be necessary to update two totals every time: One (1)should be added to the number of pupils in the specific group, and the mark should be added to the total of marks in that group (because later you have to calculate the average). You will need one or more if statements
showResults( ): displays the number of pupils in each group as well as the average mark for each group. However if the number of pupils in the group is zero, the average should not be calculated and displayed.