Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design an algorithm and write a C++ program will help track the reproduction rate of the Red Knot, an endangered species. In the district where

image text in transcribed

Design an algorithm and write a C++ program will help track the reproduction rate of the Red Knot, an endangered species. In the district where this Red Knot survives, conservationists annually perform a count of the number of eggs in Red Knot nests. The program takes the reports of each of the conservationists in the district and calculates the total number of eggs contained in all the nests they observed. Each conservationist's report consists of a list of numbers. Each number is the count of the number of eggs observed in one Red Knot nest. The program reads in the report of one conservationist and calculates the total number of eggs found by this conservationist. The list of numbers for each conservationist has -1 added to the end of the list. This serves as a sentinel value. The program should loop through the number of reports and calculates the total number of eggs found for each report. Also, your program should calculate the total egg count for all reports. The body of a loop may contain any kind of statement, so it is possible to have loops nested within loops. The output should be displayed on the screen and also to an output file. Sample Output on Screen: a list of numbers. Each number is the count of the eggs observed in one Red Knot nest. This program then tallies the total number of eggs. How many conservationist reports are there? 3 Enter the report of conservationist number 1 Enter the number of eggs in each nest. Place -1 at the end of your list. 2 3 5 3 4 2 1 4 - 1 Total egg count for conservationist number 1 is 24 Enter the report of conservationist number 2 Enter the number of eggs in each nest. Place -1 at the end of your list. 1 4 2 5 3 3 2-1 Total egg count for conservationist number 2 is 44 Enter the report of conservationist number 3 Enter the number of eggs in each nest. Place -1 at the end of your list. 3 4 4 2 2 1 5 3-1 Total egg count for conservationist number 3 is 68 Total egg count for all reports = 136 Process returned 0 (0x0) execution time : 112.926 s Press any key to continue

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_2

Step: 3

blur-text-image_3

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions