Question: in c++ using vector Below is a list of the 14 countries in South America, including their population and area: Name Population (in 1,000's) Area

 in c++ using vector Below is a list of the 14

countries in South America, including their population and area: Name Population (in

1,000's) Area (sq. miles) 45,258 1,073,234 Argentina Bolivia 11,696 424,052 Brazil 212,845

in c++ using vector

Below is a list of the 14 countries in South America, including their population and area: Name Population (in 1,000's) Area (sq. miles) 45,258 1,073,234 Argentina Bolivia 11,696 424,052 Brazil 212,845 3,287,086 Chile 19,206 291,855 Columbia 51,115 440,715 Ecuador 17,705 106,851 4,700 Falkland Islands French Guiana 290 32,253 787 Guyana Paraguay 82,978 157,056 7,145 Peru 33,108 496,093 Suriname 586 63,252 3,475 68,037 Uruguay Venezuela 28,102 353,748 Create a class called Country. O The properties (variables) of each country will be its name, population, and area. Put the definitions of those properties and prototypes of functions in a header file with a guard. Put the function definitions in a .cpp file. o Functions should include a constructor and "getters" for each property of the class. Then, similar to what you did in project 1: 1. Create an empty vector of Country elements (make this a global variable). 2. In main, in alphabetic order, create a Country object for each of the countries in South America. o as each is created insert it into the vector in ascending order based on the country's area. o consider writing a function which takes a Country object and inserts it into the vector in the appropriate spot in the vector. 3. Once the vector is filled, print a report showing each country. o At the top of the report, put headings at the top of each column. . Do not use pop_back. Instead, simply use a loop to access and print the values of each country in the vector, starting with element #O. 4. Inside the loop, use the cout object to align columns: The name of the country should be left-aligned (padded to the right) - The population and area should be right-aligned (padded to the left) 5. The first part of your report might look like the following: The population and area should be right-aligned (padded to the left) 5. The first part of your report might look like the following: Country Population Area Falkland Islands 3 4700 French Guiana 290 32253 Suriname 586 63252 3475 68037 Uruguay Guyana Ecuador 787 82978 17705 106851 . 8. After all countries have been printed, show totals for the population and area columns

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!