Question

Assume that the population of Mexico is 128 million and that the population increases 1.01 percent...

Assume that the population of Mexico is 128 million and that the population increases 1.01 percent annually. Assume that the population of the United States is 323 million and that the population is reduced 0.15 percent annually.

Write an application that displays the populations for the two countries every year until the population of Mexico exceeds that of the United States, and display The population of Mexico will exceed the U.S. population in X years

public class Population
{
public static void main(String[] args)
{
double mexicoPop = 128;
double usPop = 323;
int year = 0;
  
// your code here

System.out.println("The population of Mexico will exceed the U.S. population in " + year + " years");
System.out.println("The population of Mexico will be " + mexicoPop + " million");
System.out.println("and the population of the U.S. will be " + usPop + " million");
}
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1
public class Population {
    public static void main(String[] args) {
        double mexicoPop = 128;
        double usPop = 323;
        int year = 0;

        while (mexicoPop < usPop) {
            year++;
            mexicoPop *= 1.0101;
            usPop *= 0.9985;
        }

        System.out.println("The population of Mexico will exceed the U.S. population in " + year + " years");
        System.out.println("The population of Mexico will be " + mexicoPop + " million");
        System.out.println("and the population of the U.S. will be " + usPop + " million");
    }
}

Add a comment
Know the answer?
Add Answer to:
Assume that the population of Mexico is 128 million and that the population increases 1.01 percent...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume that the population of Mexico is 128 million and that the population increases 1.01 percentannually....

    Assume that the population of Mexico is 128 million and that the population increases 1.01 percentannually. Assume that the population of the United States is 323 million and that the population is reduced 0.15 percent annually. Write an application that displays the populations for the two countries every year until the population of Mexico exceeds that of the United States, and display The population of Mexico will exceed the U.S. population in X years. This is JAVA prog. Pls help...

  • Assume that the population of Mexico is 114 million and that the population increases 1.01 percent...

    Assume that the population of Mexico is 114 million and that the population increases 1.01 percent annually. Assume that the population of the United States is 312 million and that the population is reduced 0.15 percent annually. Assume that the population of Japan is 125 million and that the population increases 1.00 percent annually. Write an application that displays the populations for the three countries every year until the population of Mexico exceeds that of the United States. Display the...

  • Assume a world population of 7.3 billion and a U.S. population of 323 million. a. Look...

    Assume a world population of 7.3 billion and a U.S. population of 323 million. a. Look up the present total annual U.S. primary energy consumption. Then determine the total world energy consumption in quads if the rest of the world were to use the same per capita energy as in the United States b. If the energy source mix were to remain the same as the present mix in achieving the scenario of Part a, what would be the percentage...

  • The large wave of immigration from Mexico to the United States that began four decades ago,...

    The large wave of immigration from Mexico to the United States that began four decades ago, most of it unauthorized, has to a large degree ended. As a report from the Pew Hispanic Center confirms, net migration from Mexico to the United States sank to about zero in the past five years. Did the North American Free Trade Agreement (NAFTA) play a role? Yes and no. Actually, the number of Mexicans living illegally in the United States shot up from...

  • Why Auto Makers Are Building New Factories in Mexico, Not the U.S. Mexico has accelerated past...

    Why Auto Makers Are Building New Factories in Mexico, Not the U.S. Mexico has accelerated past the U.S. South in the global competition for auto investment. Mexico’s low wages and improved logistics were part of the draw. Also, many companies, such as Audi, are attracted by Mexico’s unrivaled trade relationships. Mexico has more than 40 different free-trade agreements. The pacts give exporters from Mexico duty-free access to markets that contain 60% of the world’s economic output. The United States is...

  • On January 1, 2009, a U.S. firm made an investment in Germany that will generate $5 million annua...

    On January 1, 2009, a U.S. firm made an investment in Germany that will generate $5 million annually in depreciation, converted at current spot rate. Projected annual rates of inflation in Germany and in the United States are 5 percent and 2 percent, respectively. The real exchange rate is expected to remain constant and the German tax rate is 50 percent. Required: Calculate the expected real value (in terms of January 1, 2009 dollars) of the depreciation charge in year...

  • Question #1. Domestic mine production of copper in 2009 declined by about 9% to 1.2 million...

    Question #1. Domestic mine production of copper in 2009 declined by about 9% to 1.2 million tons and its value fell to about $6.2 billion. The principal mining States, in descending order of production— Arizona, Utah, New Mexico, Nevada, and Montana—accounted for more than 99% of domestic production; copper also was recovered at mines in Idaho and Missouri. Although copper was recovered at 29 mines operating in the United States, 20 mines accounted for about 99% of production. Recent assessments...

  • Part 1 In 1950 the U.S. had a population of 150 million and it was growing at 1.3% a year. Assume no net migration. (10...

    Part 1 In 1950 the U.S. had a population of 150 million and it was growing at 1.3% a year. Assume no net migration. (10 points total) a. In about how many years will it take for the U.S. population to double? (5 points) b. In 2010 U.S. population was 308 million. Calculate the average annual growth rate of the population over these 60 years. (5 points) Part 2 In year 1, a country has a population of 100 people;...

  • Real GDP in the United States was $17,688.89 billion in 2016 and $18,108.082 billion in 2017....

    Real GDP in the United States was $17,688.89 billion in 2016 and $18,108.082 billion in 2017. The total population of the United States was approximately 323.32 million in 2016 and increased to 325.42 million people in 2017. Calculate the total economic growth rate of the U.S. between 2016 and 2017. What was the rate of population increase between the two years? Calculate the levels of Real GDP per capita for the U.S. in 2016 and 2017. What was the growth...

  • Write a program to help answer questions like the following: Suppose the species Klingon ox has...

    Write a program to help answer questions like the following: Suppose the species Klingon ox has a population of 100 and a growth rate of 15 percent, and the species elephant has a population of 10 and a growth rate of 35 percent. How many years will it take for the elephant population to exceed the Klingon ox population? You can assume that this will happen within 10 years. Use the version of the class Species from Sakai’s Week 7...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT