Question: Write a console app called CollectLobsterSizes that continuously prompts the user to enter sizes of lobsters (in inches) until the sentinel value of -1 is
Write a console app called CollectLobsterSizes that continuously prompts the user to enter sizes of lobsters (in inches) until the sentinel value of -1 is entered. You must use a loop to get these lobster sizes from the user. As you get each lobster size, count it and accumulate it. In other words, use a counter variable and add 1 to it each time you get a lobster value. Similarly, use an accumulator variable and add each lobster size to it as you get it. After the loop is done, output the number of lobster sizes collected, the sum of lobster sizes, and the average lobster size (in inches). Turn in output showing that you collected sizes for at least five lobsters.
Make sure your loop is structured (refer to the priming read or priming input that we learned about in COP 1000).
Your average should use a variable of some type other than int.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
