Define a class called Country. A Country has population S ize, area, capital, currency, and abbreviation ( (2-3 letters taken from the country name). Define at least two constructors, at least two getter methods, at least two setter methods, and Override the toString() method and the equals() method. The equals() method must return true if the two countries have the same name and same area and false otherwise The abbreviation is the first letter and the letter before the last of the country name and must be generated automatically eg if the country name is Palestine the abbreviation is PN, if the country name is Jordan the abbreviation is JA) Write a main method, define an array of country objects, read countries data from the user, if two countries have the same abbreviation add the last letter from the country name to the abbreviation o one million. f the country inserted last Display countries whose populationSize is greater than
Define a class called Country. A Country has population S ize, area, capital, currency, and abbreviation ( (2-3 letters taken from the country name). Define at least two constructors, at least two getter methods, at least two setter methods, and Override the toString() method and the equals() method. The equals() method must return true if the two countries have the same name and same area and false otherwise The abbreviation is the first letter and the letter before the last of the country name and must be generated automatically eg if the country name is Palestine the abbreviation is PN, if the country name is Jordan the abbreviation is JA) Write a main method, define an array of country objects, read countries data from the user, if two countries have the same abbreviation add the last letter from the country name to the abbreviation o one million. f the country inserted last Display countries whose populationSize is greater than
Trending now
This is a popular solution!
Step by step
Solved in 3 steps