Question: NOTE: Q2 main program requires some modification to Q1 main program, whereas Q3 main program requires minor modification to Q2 main program. 1. Five students

NOTE: Q2 main program requires some modification to Q1 main program, whereas Q3 main program requires minor modification to Q2 main program. 1. Five students at a local middle school volunteered to sell fresh baked cookies to raise funds to increase the number of computers for the computer lab. Each student reported the number of boxes he/she sold. Cost of each box of cookies was $4.50. Write a program that will output the total number of boxes of cookies sold, the total revenue generated by selling the cookies, and the average number of boxes sold by the students. Prompt the user to enter the following information: the StudentID number and the number of boxes sold. 

2. In the program above you know the exact number of student volunteers. Now suppose that the programmer does not know the exact number of volunteers. Once again, assume that the data is in the following form, i.e. the students ID number and the number of boxes sold by the student is provided by the user. Prompt the user to enter this information as in Question 1, but here, you do not know the exact number of volunteers, instead -1 will mark the end of the data entered.

3. Finally, redo question 2, but this time declare a Boolean variable and use it to control the while loop.

NOTE: Q2 main program requires some modification to Q1 main program, whereasQ3 main program requires minor modification to Q2 main program. 1. Five

1. Five students at a local middle school volunteered to sell fresh baked cookies to raise funds to increase the number of computers for the computer lab. Each student reported the number of boxes he/she sold. Cost of each box of cookies was $4.50. Write a program that will output the total number of boxes of cookies sold, the total revenue generated by selling the cookies, and the average number of boxes sold by the students. Prompt the user to enter the following information: the StudentID number and the number of boxes sold. SAMPLE RUN (text in blue is user entered) Enter ID for student 1 : 101 Enter number of boxes sold by 101: 6 Enter ID for student 2 : 102 Enter number of boxes sold by 102 :5 Enter ID for student 3: 103 Enter number of boxes sold by 103:9 Enter ID for student 4: 104 Enter number of boxes sold by 104 :10 Enter ID for student 5 : 105 Enter number of boxes sold by 105:7 Total Revenue -$166.5 Average Boxes Sold by 5 students7.4 Done In the program above you know the exact number of student volunteers. Now suppose that the programmer does not know the exact number of volunteers. Once again, assume that the data is in the following form, i.e. the student's ID number and the number of boxes sold by the student is provided by the user. Prompt the user to enter this information as in Question 1, but here, you do not know the exact number of volunteers, instead -1 will mark the end of the data entered. 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!