Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Python. Data.txt have the following information: China 1,339,190,000 9,596,960.00 United States of America 309,975,000 9,629,091.00 Brazil 193,364,000 8,511,965.00 Japan 127,380,000 377,835.00 Canada 34,207,000 9,976,140.00
In Python. Data.txt have the following information: China 1,339,190,000 9,596,960.00 United States of America 309,975,000 9,629,091.00 Brazil 193,364,000 8,511,965.00 Japan 127,380,000 377,835.00 Canada 34,207,000 9,976,140.00
Write a program that sorts a list of Country objects in decreasing order so that the most populous country is at the beginning of the list. You should submit two files: 1: Country class file; 2: a text file to read data.txt, leverage Country class, and print out the most populous country. Country class should store the name of the country, its population, its area, and the population density In the data.txt, the attributes of each row refer to "country", "population", and "area" Example output: China: 1339190000 United States of America: 309975000 Brazil: 193364000 Japan: 127380000 Canada: 34207000
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