Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is C++ and define a class. please, solve this question with correct answer. show me the exact same sample output with your code. thank
this is C++
and define a class.
please, solve this question with correct answer.
show me the exact same sample output with your code.
thank you in advance.
Exercise P5.11. Define a class Country that stores the name of the country, its popula- tion, and its area. Using that class, write a program that reads in a set of countries and prints The country with the largest area The country with the largest population The country with the largest population density (people per square kilometer) ) Problem P5.11. Write a program following the instructions in Problem P5.11. Implement a loop in which the user is prompted to enter country information. Continue until either the user requests to quit or enters the area (or population) that is not a number or that is non-positive (in that case print out the message Incorrect input. Exit!"). Then print out the names of the country with the largest population, area and density obtained up to this point. It can happen that there are more than one country with the largest area (or population, or density). For simplicity, print out the one that appears first in the list (see the input-output sample). If the input fails during the first iteration of the loop, then do not print anything besides the message Incorrect input. Exit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started