Find latitude and longitude of utmost 20 countries, ordered by population, with a population greater or equal to the population limit given below and have atleast one currency exclusively for themselves. (countries like Madagascar, Sri Lanka but not India, USA). Use the country details from this dataset.
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
int number = 0;
ArrayList<Country> countries = new ArrayList<>();
for (Country country : countries) {
if (number < 20) {
if (country.getPopulation() >= Country.LIMIT && country.getCurrencies() > 1) {
country.findLongitude();
country.findLatitude();
number++;
}
} else {
break;
}
}
}
}
Comments
Leave a comment