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
15. Write a program in python to read three numbers in three variables and swap first two variables with the sums of
ivann1987 [24]

Answer:

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))

c = int(input("Enter third number: "))

a,b = a+b,b+c

print(a,b,c)

Explanation:

Assignments like this are easy in python, in the sense that no helper variables are needed!

4 0
3 years ago
Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use
jeyben [28]

Question:

Define a function compute_gas_volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the gas equation PV = nRT, where P is pressure in Pascals, V is volume in cubic meters, n is number of moles, R is the gas constant 8.3144621 ( J / (mol*K)), and T is temperature in Kelvin.

Answer:

This solution is implemented in C++

double compute_gas_volume(double P, double T, double n){

   double V = 8.3144621 * n * T/P;

   return V;

}

Explanation:

This line defines the function, along with three parameters

double compute_gas_volume(double P, double T, double n){

This calculates the volume

   double V = 8.3144621 * n * T/P;

This returns the calculated volume

   return V;

}

To call the function  from the main, use:

<em>cout<<compute_gas_volume(P,T,n);</em>

<em />

<em>Where P, T and n are double variables and they must have been initialized</em>

5 0
3 years ago
A good website design combines which of the following elements? (select all that apply) powerful web server hardware components
Anarel [89]

Sounds like it'd be all of the above.


7 0
3 years ago
Read 2 more answers
Challenge activity 6.1.3 function call with parameters
Kobotan [32]

Answer:

Printing formatted measurement Define a function PrintFeetinchShort, with int parameters numFeet and numinches, that prints using and "shorthand. End with a newline. Ex: PrintFeetinchShort(5, 8) prints: 5' 8" Hint: Use to print a double quote. ра 1 #include <stdio.hu 2 3 / Your solution goes here */ 4 5 int main(void) 6 int userFeet: 7 int user Inches: 8 9 scanf("%d", BuserFeet): 10 scanf("%d", Suser Inches); 11 12 PrintFeet InchShort(userFeet, user Inches); 13 14 return 0; 15) // Will be run with (5, 8), then (4, 11) Run

5 0
2 years ago
Jamie found the ISBN of the book she wanted to order in the Books in Print Catalog. To remember the eleven-digit number, 1977255
algol13

Answer:

Chunking

Explanation:

Chunking refers to the process of taking individual pieces of information (called chunks) and grouping them into larger units. By grouping each piece into a large whole, you can improve the amount of information you can remember.

5 0
2 years ago
Other questions:
  • Discus the pros and cons of Internal cloud service and External cloud service for both Infrastructure as a service and Applicati
    11·1 answer
  • What are the main types of computer software?
    5·2 answers
  • In an is framework, ________ is the bridge between the computer side on the left and the human side on the right
    12·1 answer
  • IBF Consultants, LLC provides consulting services in privacy and theft deterrence solutions. Another client has very sensitive d
    7·1 answer
  • To hide gridline when you display or print a worksheet
    14·1 answer
  • Write a Program in C language using arrays:
    14·1 answer
  • How would you define the rule of thirds?
    11·1 answer
  • If someone wanted to talk to a financial institution representative in person they would need to _____.
    5·1 answer
  • Code: ckg-jbqp-hki<br>only girls join❤️​
    11·2 answers
  • What dictionary operation can you use to remove all the keys within the dictionary-named contacts?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!