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