I want to be able to store distances between cities using C++, and store these distances using an array of 2D double (data type). I then want to ask the user to enter two of these cities and output the distances between the two cities.
This is what I've come up with so far:
The data itself in terms of correct distances isn't accurate as you can see, but my main focus is to try and implement the code so made up some data...
Quote:
NewYork to Westbury: 220.8 miles
NewJersey to England: 99.43 miles
Miami to Los Angeles: 384.39 miles
Florida to Spain: 394.20 miles
California to Paris: 39.40 miles
Code:double array[2][2] = {[0][4320.55], [0][32.77], [0][561.52], [0][243.57], [0][5479.16]};
// string cities[5] = {"Newyork", "Westbury",
Am I storing the distances in the array correctly, I don't seem to know how to go about doing this, I was going to store all cities in an array of the string data type. I also cannot use more than five cities which confused me even more as you can see from my code I had to stop...