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.)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter3: Input/output
Section: Chapter Questions
Problem 4PE: 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and...
icon
Related questions
Question

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:

  1. a)  Prompt the user to enter the world population (use long long date type).

  2. b)  Prompt the user to enter the name of the country, e.g., U.S.A. (use string data type).

  3. c)  Prompt the user to enter the population of the country (use long long date type).

  4. d)  Compute the ratio of the country’s population compared to that of the entire world:

    radio = country’s population / the entire world population

  5. 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.)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,