Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

=+ Why have these changes occurred?

Answered: 1 week ago

Question

=+90 percent of all oil refineries) into several smaller companies

Answered: 1 week ago