1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sophie [7]
3 years ago
7

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

ulation 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
Computers and Technology
1 answer:
horrorfan [7]3 years ago
6 0

Answer:

//Define class

public class Main {

 //define main method

 public static void main(String[] args)  

 {

   //declare and initialize the double type variable to 128

   double mexico = 128;

   //declare and initialize the double type variable to 323

   double us = 323;

   //declare and initialize the integer type variable to 0  

   int yr = 0;

   //set the while loop to check which is greater

   while (mexico < us)  

   {

     //increment in the variable by 1

     yr++;

     //initialize in the variables acc. to the percentage

     mexico *= 1.0101;

     us *= 0.9985;

   }

   //print the following results

   System.out.println("Population of the Mexico will be exceed the population U.S. in " + yr + " years");

   System.out.println("Population of the Mexico will be " + mexico + " million");

   System.out.println("and population of the U.S. will be " + us + " million");

 }

}

<u>Output</u>:

Population of the Mexico will be exceed the population U.S. in81 years

Population of the Mexico will be 288.88435953355025 million

and population of the U.S. will be 286.0198193927948 million

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, we define the class 'Main' and inside it, we define the main method.
  • Then, declare two double data type variables which are 'mexico' and 'us' and initialize in it to 128 and 323.
  • Declare integer data type variable 'yr' and initialize in it to 0.
  • Set the while loop and pass the condition to check that the variable 'mexico' is less than the variable 'us' then, increment in the variable 'yr' by 1 and multiply the variables 'us' and 'mexico' by the following percentage.
  • Finally, print the following results with the message.
You might be interested in
You are critiquing a logo design that one of your coworkers proposed. Your sense is that the individual elements of the design a
oksano4ka [1.4K]

Answer:

Unity.

Explanation:

Graphic design can be defined as an art which typically involves the combination of texts, images and colors to communicate an idea.

In graphic design, unity refers to the harmonious relationship between the various elements in a graphical piece of art, thus, making it appear as a single beautiful piece. Therefore, unity ensure a piece of work does not appear to the viewer as separate pieces but rather presents it as a single piece.

In this scenario, you are critiquing a logo design that one of your coworkers proposed. Your sense is that the individual elements of the design are fine, but when they are combined, they just don’t work well together. Thus, the main problem with this logo is unity.

8 0
2 years ago
How do you know if something is in the public domain
liraira [26]
You can start by looking at the date. Anything made before 1923, no matter what, will be definitely in the public domain. ... Most times, it's impossible to determine whether something is in the public domain just by the date. There are three ways you can find out definitively whether a work is in the public domain.
8 0
3 years ago
Evaluate and compare free and commercial versions of the Avast antivirus software
Ivan

Answer:

Explanation:

Explanation:

Explanation:

Explanation:

Explanation:

Explanation:

8 0
2 years ago
Woah my favorite character got arrested
olasank [31]

Not sure how to answer this. But shaggy was quite amazing.

4 0
2 years ago
Read 2 more answers
A person appreciation of a food taste and flavor is commonly referred to as what
Nimfa-mama [501]

Answer:

Palate - A person’s appreciation of taste and flavor, especially when sophisticated and discriminating Eclectic - Deriving ideas, style, or taste from a broad and diverse range of sources Piquancy - A pleasantly sharp and appetizing flavor

6 0
2 years ago
Other questions:
  • How can we set the color of a text that acts as a link in a web page​
    10·2 answers
  • Which forensics tool would you use to reveal recent pages viewed via the internet explorer browser?
    10·1 answer
  • If johnny has 800 socks and john has 1000 more how much does john have
    9·1 answer
  • Janelle is at the store and can't decide whether to buy steak for dinner or bring home pizza. To get a quick response from her p
    13·1 answer
  • How to program a game​
    7·2 answers
  • A network administrator determines who may access network resources by assigning users
    10·1 answer
  • What is essential for a good study routine? Select four options.
    7·1 answer
  • Your motherboard has sockets for 184-pin dimm ram. which type of ram should you install?
    15·1 answer
  • PLEASE HELP! (NO LINKS)
    7·1 answer
  • How can a classroom be more effective by the use of multimedia? ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!