Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer question #4 please. The language is Java and here is the Country class and .csv file. private String name; private String code; private
Please answer question #4 please. The language is Java and here is the Country class and .csv file.
private String name; private String code; private String capitol; private int happinessRank; private double population; private double GDP; public Country(String name,String code,String capitol,double population,double gdp,int hr) { this.name=name; this.code=code; this.capitol=capitol; this.population=population; GDP=gdp; happinessRank=hr; } public String getCapitol() { return capitol; } public void setCapitol(String capitol) { this.capitol = capitol; } public double getPopulation() { return population; } public void setPopulation(int population) { this.population = population; } public int getHappinessRank() { return happinessRank; } public void setHappinessRank(int happinessRank) { this.happinessRank = happinessRank; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public double getGDP() { return GDP; } public void setGDP(double gDP) { GDP = gDP; } @Override public String toString() { return name+","+code+","+capitol+","+population+","+GDP+","+happinessRank; } @Override public int compareTo(Country arg0) { if (this == arg0) return 0; return this.name.compareTo(arg0.name); } }
Country Name | Country Code | Capitol City | Population | GDP | Happiness Rank |
South Korea | KOR | Seoul | 51709098 | 2.24E+12 | 55 |
Hong Kong of China | HKG | Hong Kong | 7451000 | 3.63E+11 | 71 |
Azerbaijan | AZE | Baku | 9942334 | 4.69E+10 | 85 |
Thailand | THA | Bangkok | 69428524 | 5.05E+11 | 32 |
Cyprus | CYP | Nicosia | 1189265 | 2.45E+10 | 65 |
Saudi Arabia | SAU | Riyadh | 33699947 | 7.82E+11 | 37 |
Malawi | MWI | Lilongwe | 18143315 | 7.06E+09 | 136 |
Nigeria | NGA | Abuja | 1.96E+08 | 3.97E+11 | 95 |
Rwanda | RWA | Kigali | 12301939 | 9.51E+09 | 151 |
Angola | AGO | Luanda | 30809762 | 1.06E+11 | 140 |
Ivory Coast | CIV | Yamoussoukro | 23740424 | 1.06E+11 | 128 |
Sweden | SWE | Stockholm | 10183175 | 5.51E+11 | 9 |
Zambia | ZMB | Lusaka | 17351822 | 2.67E+10 | 116 |
Benin | BEN | Porto-Novo | 11485048 | 1.04E+10 | 143 |
Sri Lanka | LKA | Colombo | 21670000 | 8.89E+10 | 120 |
Lebanon | LBN | Beirut | 6848925 | 5.66E+10 | 88 |
Kyrgyz Republic | KGZ | Bishkek | 6315800 | 8.09E+09 | 98 |
Iceland | ISL | Reykjavik | 353574 | 2.59E+10 | 3 |
Gabon | GAB | Libreville | 2119275 | 1.7E+10 | 118 |
Bangladesh | BGD | Dhaka | 1.61E+08 | 2.74E+11 | 110 |
Denmark | DNK | Copenhagen | 5797446 | 3.51E+11 | 2 |
Kuwait | KWT | Kuwait City | 4137309 | 1.42E+11 | 39 |
United Kingdom | GBR | London | 66488991 | 2.83E+12 | 19 |
Chad | TCD | N'Djamena | 15477751 | 1.13E+10 | 137 |
Honduras | HND | Tegucigalpa | 9587522 | 2.38E+10 | 91 |
Israel | ISR | Jerusalem | 8883800 | 3.70E+11 | 11 |
Qatar | QAT | Doha | 2781677 | 1.92E+11 | 35 |
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