1.Learners at a local basic school volunteered to sell fresh baked bread to raise funds to increase the number of computers for their computer lab. Each student reported the number of loaves of bread he/she sold. Write a C programme that will output the total number of loaves of bread sold, the total revenue generated by selling the bread, and the average number of loaves of bread sold by each student. The input data is provided in the following form: studentIndexNo numOfBoxesSold. Save
2.The programme in 1. above computes and outputs the total number of loaves of bread sold, the total money made, and the average number of loaves sold by each student. However, the programme assumes that the programmer knows the exact number of volunteers. Now suppose that the you do not know the exact number of volunteers. Modify your programme in 1 i), assuming that the data is in the following form: student’s index number followed by a space and the number of loaves sold by the student. Since you do not know the exact number of volunteers, assume that -1 will mark the end of the data.
Kindly add simple comments to explain your simple codes to enhance understanding.Thank you
KINDLY ANSWER QUESTION 2 ONLYWITHOUT READING OR WRITING ON THE A FILE
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here