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
Marina86 [1]
3 years ago
13

The population of town A is less than the population of town B. However, the population of town A is growing faster than the pop

ulation of town B. Write a program that prompts the user to enter: The population of town A The population of town B The growth rate of town A The growth rate of town B The program outputs: After how many years the population of town A will be greater than or equal to the population of town B The populations of both the towns at that time. (A sample input is: Population of town A = 5,000, growth rate of town A = 4%, population of town B = 8,000, and growth rate of town B = 2%.)
Computers and Technology
1 answer:
defon3 years ago
3 0

Answer:

#include<iostream>

using namespace std;

void main()

{

int townA_pop,townB_pop,count_years=1;

double rateA,rateB;

cout<<"please enter the population of town A"<<endl;

cin>>townA_pop;

cout<<"please enter the population of town B"<<endl;

cin>>townB_pop;

cout<<"please enter the grothw rate of town A"<<endl;

cin>>rateA;

cout<<"please enter the grothw rate of town B"<<endl;

cin>>rateB;

while(townA_pop < townB_pop)//IF town A pop is equal or greater than town B it will break

{

townA_pop = townA_pop +( townA_pop * (rateA /100) );

townB_pop = townB_pop +( townB_pop * (rateB /100) );

count_years++;

}

cout<<"after "<<count_years<<" of years the pop of town A will be graeter than or equal To the pop of town B"<<endl;

}

Explanation:

You might be interested in
Whats the next lyric,i baked you a pie,pie,pie
eduard
“oh boy what flavor”
4 0
3 years ago
Read 2 more answers
Advantages of a computer​
Bess [88]

Answer:

It eases work.

It is deligent.

It is versatile.

8 0
3 years ago
How do you fix The lag on your zsnes emulator
GenaCL600 [577]
Try resetting the phone if that doesn’t work do a hard reset
7 0
2 years ago
A special kind of keyboard that can help people type really fast is the Colemak.
Lady bird [3.3K]
The answer is True there is a keyboard like that here

4 0
3 years ago
Read 2 more answers
According to the narrator of "EPIC 2015, in 2015, "news" is:
statuscvo [17]

Answer:

D created by apathetic journalists who care little how true a story is.

Explanation:

D

6 0
3 years ago
Read 2 more answers
Other questions:
  • Under extreme programming, ________ and ________ are intimately related parts of the same process
    13·2 answers
  • Write a Temperature class that will hold a temperature in Fahrenheit, and will provide methods to get and display the temperatur
    5·1 answer
  • Do the police check your mobile device during police checks?
    10·2 answers
  • One of your clients has opened a branch office in another state. Both the main office and the new branch office have fast, relia
    10·1 answer
  • Which CSS attribute would change an element's font color to blue
    15·2 answers
  • Testing a function or program using test values that are at or near the values that change the outcome of the program is known a
    13·1 answer
  • A social cause is: O A. when one person protests without the support of others. B. something that not many citizens think or car
    8·1 answer
  • This is your data.
    11·2 answers
  • Initialized the variable with the value 0
    11·2 answers
  • A threat analyst is asked about malicious code indicators. Which indicator allows the threat actor's backdoor to restart if the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!