Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C + + program that will predict the size of a population of lovebugs for a certain number of days. The user will
Write a C program that will predict the size of a population of lovebugs for a certain number of days. The user will enter the starting number of lovebugs, the average daily percent increase in its percentage form, say and the number of days the lovebugs will mulitply. In order for the population to increase, there must be a minimum of two lovebugs. Be sure to validate all input values. Use a C loop while loop, dowhile loop, or for loop to calculate the population values to to print to the screen. Round all population values to decimal places. Be sure the program calculates and displays a table of data showing the correct calculated increase in population for the number of days requested. Also be sure the program does not allow invalid input to be entered, for instance if a negative percentage were entered a number less than zero were entered, an error message would pop up Also include an algorithm for the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started