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
Anit [1.1K]
3 years ago
9

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

ulation of the United States is 312 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 excceds that of the United States, and display the number of years it took. Save file as Population.java.***NOTE**** This is my first class of java the program that I have to write has to be of what we have learned in the last 6 chapters it cannot have stuff that is way more advanced than the first 6 chapters.
Computers and Technology
1 answer:
AfilCa [17]3 years ago
6 0

Answer:

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

   double mexico = 114;

   double usa = 312;

   double mexicoRate = .0101;

   double usaRate = .0015;

// calculate population after every year until mexico population exceed the usa populationn

   while (usa>mexico)

   {

// print the population

       cout<<"Mexico's population ::"<<mexico<<" million."<<endl;

       cout<<"USA's population ::"<<usa<<" million."<<endl;

// update the population

       mexico+=mexico*mexicoRate;

       usa-=usa*usaRate;

   }

return 0;

}

Explanation:

Declare and initialize mexico and usa with their initial population.Also declare and initial their increase and decrease rate.Find the population of both the  country each year until mexico population exceeds the usa population.

Output:

Mexico's population ::114 million.                                                                                          

USA's population ::312 million.                                                                                            

Mexico's population ::115.151 million.                                                                                      

USA's population ::311.532 million.

.

.

.

Mexico's population ::270.546million.                                                                                      

USA's population ::274.213 million.                                                                                        

Mexico's population ::273.278million.                                                                                      

USA's population ::273.802 million.

You might be interested in
In relation to data science,advances in technology has made it more feasible to do what
Reika [66]
In recent years data science has become less and less about the data itself, and more about the technology and tools used to interact with it. Advanced solutions like AI, machine learning and robust analytics tools make it possible not just to process and understand massive stores of information but at unprecedented speeds.
3 0
3 years ago
Joshua is creating his résumé, in which section will he add projects and trainings he was involved in?
enot [183]
You put it in the skills and certifications section
4 0
3 years ago
If you wanted to look up an article from the Chicago Tribune the best place to start would be
anyanavicka [17]
Books,well trusted websites , news.reports , schools library (online and off ) hope this helps.:-)
7 0
3 years ago
Blind spots are those areas not reflected in your:
bulgar [2K]
The answer is C because your sideview and rearview mirrors are there specifically to check behind you, while the vanity mirror is not supposed to be used for the same purpose.
8 0
3 years ago
Read 2 more answers
PLEASE HELP! WILL MARK AS BRAINLIEST JavaScript can be implemented using the _________ HTML tags in a web page.​
Keith_Richards [23]

Answer:

JavaScript can be implemented using JavaScript statements that are placed within the ...  HTML tag

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Access controls are enforced automatically in FMS service routines that access and manipulate files and directories.
    9·1 answer
  • The google android mobile operating system is a proprietary system, for use on only approved devices.​
    10·1 answer
  • True false you cannot fill in a callout​
    14·1 answer
  • . Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push
    13·1 answer
  • What is the simplest way to permanently get rid of a unwanted file
    12·1 answer
  • Match the terms with their definitions.
    5·2 answers
  • Settings to control the amount of notifications is a
    10·2 answers
  • A byte contains how many bits? Question 3 options:
    13·2 answers
  • Can someone help I think I know it but I wanna make sure I’m right
    10·1 answer
  • What invention in the past do you think had a significant impact on our culture/ lifestyle? What do you think will be invented/
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!