Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the program in c The town of Rien, Ohio currently has a population 9.870,

ID: 3676619 • Letter: W

Question

Write the program in c The town of Rien, Ohio currently has a population 9.870, Due to the recent boom in craft breweries in the town, the population has been groweing at a rata 10% per year. The city fathers are concerned about what will happen when the town reaches 30,000 people and the strain that this type of population will put on the public utilities etc., You are to write a program that uses a loop to compute in what year Rien will reach 30,000 people But you immediately realize that if you made the program more general, allowing a community to enter their current population and their "target" population, they could also use this software. So you are to have the user enter the current year the current population and target population has been reached or exceeded (Note that poulation growth is like compound interest, the "interest" is computed as a percentage of the larger population at the end of each year: In the year 2027 you will exceed your target of 30000 with a population of 30968{Note that values m bold have been entered by the user.} Your program should have a comment block at the top of the program which includes your name and some information about the program. It should work for any year or population

Explanation / Answer

/* C program to find out
in which year current population
exceeds the target population
*/

#include <stdio.h>

int main ()
{
int year;
float current_population;
float percentage;
int target_population;
printf("Welcome to Population Projector. ");
printf("Begin by entering the current year => ");
scanf("%d",&year);
printf("Now enter your town's current Population => ");
scanf("%f",&current_population);
printf("Enter the expected population growth as a percentage => ");
scanf("%f",&percentage);
printf("Now enter the target population => ");
scanf("%d",&target_population);
printf(" ");

printf(" %d %d ",year,(int)current_population);
while(current_population < target_population)
{
year++;
current_population = (int) ( current_population *(1+ percentage/100));
if(current_population < target_population) printf(" %d %d ",year,(int)current_population);
  
}

printf("In the year %d you will exceed your target of %d with a population of %d ",year, target_population, (int)current_population );
return 0;
}