#include <iostream>
#include <cmath>
#include <fstream>
usingnamespace std;
/* Main Function: */
int main() {
float x0, x1, x2, x3, x4;
float y0, y1, y2, y3, y4;
char character;
ifstream in;
ofstream out;
/* CALLING THE DATA FILE NAMED (week4Q5_input) */
in.open("week4Q5_input");
if (in.fail()) {
cout << "Sorry, but the file couldn't be opened.\n\n";
exit(1);
}
/* CREATE FILE TO STORE OPTAINED DATA */
out.open("week4Q5_output");
in >> character >> x0 >> y0;
in >> character >> x1 >> y1;
in >> character >> x2 >> y2;
in >> character >> x3 >> y3;
in >> character >> x4 >> y4;
out << "The distance between A and B is '" << " " << sqrt(pow(x1-x0,2) + pow(y1-y0,2)) << "'." << endl;
cout << "The distance between A and B is '" << " " << sqrt(pow(x1 - x0, 2) + pow(y1 - y0, 2)) << "'." << endl;
out << "The average distance is '" << " " << "" << "'." << endl;
cout << "The average distance is '" << " " << "" << "'." << endl;
out << "The maximum distance is '" << " " << "" << "'." << endl;
cout << "The maximum distance is '" << " " << "" << "'." << endl;
out.close();
in.close();
system("PAUSE");
return 0;
}