ounter controlled while loop 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...


ounter controlled while loop


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



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here