Create a C++ program to compare the populations of the entire world and U.S.A. or another country. The program should include the following parts: a) Prompt the user to enter the world population (use long long date type). b) Prompt the user to enter the name of the country, e.g., U.S.A. (use string data type). c) Prompt the user to enter the population of the country (use long long date type). d) Compute the ratio of the country’s population compared to that of the entire world: radio = country’s population / the entire world population e) Display comparison result as follows (should display 2 decimal places in the percentage format output): The population of country XXX is YYY.YY % of the world population. (Note: you need to make sure XXX, and YYY.YY will be replaced by country name and percentage.)
Create a C++ program to compare the populations of the entire world and U.S.A. or another country. The program should include the following parts:
-
a) Prompt the user to enter the world population (use long long date type).
-
b) Prompt the user to enter the name of the country, e.g., U.S.A. (use string data type).
-
c) Prompt the user to enter the population of the country (use long long date type).
-
d) Compute the ratio of the country’s population compared to that of the entire world:
radio = country’s population / the entire world population
-
e) Display comparison result as follows (should display 2 decimal places in the percentage format output):
The population of country XXX is YYY.YY % of the world population.
(Note: you need to make sure XXX, and YYY.YY will be replaced by country name and percentage.)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images