(Need to use sentinel-controlled while loop)

this is the work "students at a school volunteered to sell fresh baked cookies to raise funds to increase the number of computers in the computer lab. Each student reported the number of boxes he/she sold. Write a program that wil output the total number of boxes of cookies sold, the total revenue generated by selling the cookies and the saverage number of boxes sold by each student. The programmer do not know the exact number of volunteers involved, we assume that -1 that will mark the end of the data.

Assume the data input is in the following form: student's name followed by a space and the number of boxes sold by the student

this is the work "students at a school volunteered to sell fresh baked cookies to raise funds to increase the number of computers in the computer lab. Each student reported the number of boxes he/she sold. Write a program that wil output the total number of boxes of cookies sold, the total revenue generated by selling the cookies and the saverage number of boxes sold by each student. The programmer do not know the exact number of volunteers involved, we assume that -1 that will mark the end of the data.

Assume the data input is in the following form: student's name followed by a space and the number of boxes sold by the student

a sentinel while look for that would look like

do

{

things

}

while(input != -1)

or

input = 0;

while(input != -1)

{

things

}

do

{

things

}

while(input != -1)

or

input = 0;

while(input != -1)

{

things

}

Registered users can post here. Sign in or register to post.