Assume you have the following
Cityclass:
public class City{ private String name; private double north; // north latitude in degrees private double west; // west longitude in degrees //************************************************************** public City(String name, double latitude, double longitude) { this.name = name; this.north = latitude; this.west = longitude; } // end constructor //************************************************************** public void display() { System.out.printf("%12s%6.1f%6.1f\n", name, north, west); }} // end class CityWrite a code fragment that (1) creates a 4-element array of
Cityobjects, (2) fills the array with the following data, and (3) uses a loop to display the array’s contents like this:
New York
41.0
74.0
Miami
26.0
80.0
Chicago
42.0
88.0
Houston
30.0
96.0
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.