From the program above, there are several repetitions. To improve the program, we should use methods to replace the repetitions and to separate the program into smaller parts. Assume we allow 2 methods ReadPoint and Distance for this program. ReadPoint is to read the coordinate of a point. Distance is to calculate a euclidean distance between 2 points.