Using C# Language:

a) Write a method `PopulationTotal` that accepts two positive values: the current population (in millions, e.g., a value of 1.5 means 1.5 million people) and the growth rate (e.g., 0.14 means 14%). The method determines and returns the total population based on the current population and growth rate. For example, if the current population for a country is 1.165 million people, and the annual population growth rate is 10%, then the total population is 1.2815 million people after 1 year.

b) Write a method `Over180Million` that accepts a positive value representing the population (in millions). The method determines whether the population is over 180 million people and returns a value of true if this is so, otherwise returns a value of false.

c) Write a program that requests the user for a year (you can assume the year will always be at least 2000), the population of Brazil in that year (in terms of millions of people), and the annual population growth rate (always as a real number in the range 0 – 1). The program then uses the two methods written above to determine and display the year in which Brazil’s population first exceeded/exceeds 180 million people. The program must also display Brazil’s total population in this year.

d) Assume that in 2001 the population of Brazil was 97.6 million people and the rate at which the population grows was 18.4% per year. Use your program to answer the following two questions:
i) Using this test data, what is the year displayed by the program written in c)?
ii) What is the total population displayed by the program written in c)?

Answer :

The program assumes valid input and doesn't include extensive error handling. It's always important to validate and Sanitation user input in real-world applications.

The program defines two methods: populationTotal and over180Million. populationTotal calculates the total population based on the current population and growth rate, while over180Million checks if the population exceeds 180 million.

In the main method, the user is prompted to enter the year, current population, and growth rate. The program calculates the year when Brazil's population exceeds 180 million by repeatedly applying the growth rate until the population surpasses the threshold.

After obtaining the result, the program displays the year and the total population. It then performs a similar calculation using the provided test data and displays the results for comparison.

To know more about Sanitation click the link below:

brainly.com/question/30360351

#SPJ11

Other Questions