Please fill in the If function if they put in a negative value, and the esxtmated population per year. please use my code. im not sure how to fish it If P is the population of the first day of the year, B is the birth rate and D is the death rate, the estimated population at the end of the next year is given by formula: P + ( B * P ) / 100 – ( D * P ) / 100
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Please fill in the If function if they put in a negative value, and the esxtmated population per year. please use my code. im not sure how to fish it
If P is the population of the first day of the year, B is the birth rate and D is the death rate, the estimated population at the end of the next year is given by formula:
P + ( B * P ) / 100 – ( D * P ) / 100
The population growth rate is given by the formula: B - D
create a program that prompts the user to enter the starting population, birth and death rates and the number of years to project. The program should then calculate and print the growth rate and the estimated population after each year. Your program must contain the following functions:
GrowthRate: This function takes as its parameters the birth and death rates and returns the population growth rate.
Estimated Population: This function takes as its parameters the current population, the birth rate and the death rate. It returns the estimated population for the next year. Your program should not accept negative birth rate, negative death rate or population of less than 2.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images