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
Write any 2 differences between implicit variables and explicit variables.​Plz tell :' (
Marrrta [24]
Explicit is stated very clearly
Implicit is implied
Explicit leaves no room for confusion
Implicit doesn’t have to be directly stated
3 0
3 years ago
Assume that success is a variable of type boolean that has been declared. Assume that processor refers to an object that provide
Iteru [2.4K]
Try {
AutoFactory.shutdown();
} catch (ProductionInProgressException e) {
AutoFactory.reset();
}
6 0
2 years ago
Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
erica [24]
Consensus Building is NOT a technique that you can use to help you in identifying a problem.
8 0
3 years ago
John wants to know the amount of ram memory installed on his computer. in which category of the windows 7 control panel can this
Verizon [17]

John can find the amount of Random Access Memory (RAM) memory installed on his computer with the Windows 7 under the category “<u>System and Security</u>” in the Control Panel.

To know the total amount of installed RAM through Control Panel in the computer with Windows 7, John should follow the steps as:

  • Click the Windows key
  • Type Control Panel
  • Click the category named “System and Security”
  • Now under “System”, click “View amount of RAM and processor speed”
  • “Device Specifications” section displays the amount of installed RAM in John’s computer

Thus, above are the steps by which John’s can find the amount of installed RAM in his Windows 7 computer’s Control Panel.

What is Random Access Memory (RAM)?

RAM is the temporary memory in computers that stores the data currently being used by the processor.

You can learn more about Control Panel at

brainly.com/question/1445737

#SPJ4

5 0
1 year ago
What is your opinion on gaming? do you think it has more positive or negative impacts
joja [24]

Answer:

positive bc you can learn from them wwhat to do what not to do mistakes that you wont make in. real life

4 0
2 years ago
Read 2 more answers
Other questions:
  • A centralized structure does not provide information from local stores that would be useful in changing its technology quickly.
    15·1 answer
  • The code segment below uses the procedure IsPartOf (list, item), which returns true if item appears in list and returns false ot
    13·1 answer
  • QUESTION: Which is not an example of a video port or cable?
    10·1 answer
  • Select the correct answer.
    5·2 answers
  • Oiê gentee, bom dia O que você entende por cultura digital ??
    12·1 answer
  • How do you think computers have helped improve documentation, support and services within the healthcare industry
    13·1 answer
  • Alan has introduced a new line of scooters on his website and is using a Google Display Ad campaign to promote them. He selects
    8·1 answer
  • Write a Python program that prints your name, CS classes taken (or other relevant experience), and the date on separate lines. U
    5·1 answer
  • Suppose your name was George Gershwin. Write a complete main method that would print your last name, followed by a comma, follow
    9·1 answer
  • What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!