Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Headers/Lib110ct.h"
- #include <string>
- using namespace std;
- int main(int argc, char** argv)
- {
- Win110ct win;
- double distances[5][5] = {{0,102,290,111,129},
- {102,0,373,150,231},
- {290,373,0,372,186},
- {111,150,372,0,194},
- {129,231,186,194,0}};
- string cities[] = {"Birmingham","Edinburgh","London","Cardiff","York"};
- int choices[2];
- //task 1 code goes here...
- for(int i=0; i<2; ++i)
- {
- win << "Enter city " << i+1 << "\n";
- for(int j=0; j<5; ++j)
- win << j << ". " << cities[j] << "\n";
- win >> choices [i];
- win.clear();
- win.setPosition(0,0);
- }
- win << "The distance between the cities is: " << distances[choices[0]][choices[1]] << "miles";
- win.getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement