subject

In C++ please:
Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. A loop should display the size of the population for each day.
Prompts, Output Labels and Messages:
The three input data should be prompted for with the following prompts: "Enter the starting number of organisms: ", "Enter the average daily population increase (as a percentage): , and "Enter the number of days they will multiply: " respectively. The population sizes displayed should appear on separate lines, each of the form "On day D the population size was P." where D is the day number (starting with 1) and P is the population you calculated for that day.
Input Validation:
Do not accept a number less than 2 for the starting size of the population. If the user fails to satisfy this print a line with this message "The starting number of organisms must be at least 2.", display the prompt again and try to read the value . Similarly, do not accept a negative number for average daily population increase , using the message "The average daily population increase must be a positive value ." and retrying. Finally, do not accept a number less than 1 for the number of days they will multiply and use the message "The number of days must be at least 1."

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:10
The total cost of textbooks for the term was collected from 36 students. create a histogram for this data. $140 $160 $160 $165 $180 $220 $235 $240 $250 $260 $280 $285 $285 $285 $290 $300 $300 $305 $310 $310 $315 $315 $320 $320 $330 $340 $345 $350 $355 $360 $360 $380 $395 $420 $460 $460
Answers: 2
question
Computers and Technology, 22.06.2019 19:10
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
You know the right answer?
In C++ please:
Write a program that will predict the size of a population of organisms. The pr...
Questions
question
History, 16.02.2021 17:40
question
History, 16.02.2021 17:40
question
Mathematics, 16.02.2021 17:40
question
Mathematics, 16.02.2021 17:40
question
Mathematics, 16.02.2021 17:40
question
Biology, 16.02.2021 17:40
question
Mathematics, 16.02.2021 17:40
question
Mathematics, 16.02.2021 17:40
Questions on the website: 13722359