subject

Populations are effected by the birth and death rate, as well as the number of people who move in and out each year. the birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. create a program that displays the size of a population for any number of years. the program should ask for the following data:
the starting size of a population pthe annual birth rate (as a percentage of the population expressed as a fraction in decimal form)bthe annual death rate (as a percentage of the population expressed as a fraction in decimal form)dthe average annual number of people who have arrived athe average annual number of people who have moved away mthe number of years to display nyears
create a function that calculates the size of the population after a year. to calculate the new population after one year, this function should use the formulan = p + bp - dp + a - mwhere n is the new population size, p is the previous population size, and b, d, a and m are as defined above. the function should return the value computed for n and should receive the values of p, b, d, a and m as parameters. prompts and output labels. the program first displays the message "this program calculates population change." on a line by itself, followed by these prompts for the inputs described above: "enter the starting population size: " "enter the annual birth rate (as % of current population): " "enter the annual death rate (as % of current population): " "how many individuals move into the area each year? "; "how many individuals leave the area each year? "; "for how many years do you wish to view population changes? "the output of the program starts with a line: starting population: p (where p is the starting population ( and then continues with a separate line for each year, each line being of the form: population at the end of year ||y is p. (where y is the year number (1,2, starting with 1, and where p is the population calculated for that year).input validation. the program should validate all data read. none of the data should be negative, the number of years should not be less than 1 and the initial population should not be less than 2. if an invalid value is read, the program should print an error-specific message on a line by itself, followed by the directive " re-enter: " and then input another value-- until a valid value is entered. the error specific messages are: "starting population must be 2 or more.", "birth rate percent cannot be negative.", "death rate percent cannot be negative.", "arrivals cannot be negative.", "departures cannot be negative.", and "years must be one or more.".

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 24.06.2019 22:00
Need getting google account back, big issue
Answers: 2
question
Computers and Technology, 25.06.2019 02:30
Technology has changed communications by replacing or supplementing traditional modes of communication that were primarily
Answers: 2
question
Computers and Technology, 25.06.2019 08:00
Is skill in using productivity software, such as word processors, spreadsheets, database management systems, and presentation software.computer literacyinformation literacybusiness literacynetwork literacy
Answers: 1
You know the right answer?
Populations are effected by the birth and death rate, as well as the number of people who move in an...
Questions
question
Biology, 22.01.2021 20:20
question
Mathematics, 22.01.2021 20:20
question
Mathematics, 22.01.2021 20:20
question
Physics, 22.01.2021 20:20
question
Physics, 22.01.2021 20:20
Questions on the website: 13722360