Question
Solution Preview
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public class Attraction {private String name;
private String city;
private String country;
private double distance;
/**
* constructor
* @param name
* @param city
* @param country
* @param distance
*/
public Attraction(String name, String city, String country, double distance) {
this.name = name;
this.city = city;
this.country = country;
this.distance = distance;
}
/**
*
* @return string expression of the attraction
*/
@Override
public String toString() {
String expression = "";
expression = "Attraction Name: " + name + "\n" +
"Attraction City: " + city + "\n" +
"Attraction Country: " + country + "\n" +
"Distance from Seattle: " + distance + "\n";
return expression;
}...