public class PointOfPlane { private static int count=0; // counter of points constructed private final int me; // the unique identity of a point private double x, y; // the coordinates public PointOfPlane(double x, double y) { this.x = x; this.y = y; ++count; me=count; } public int who() {return me;} public void set(double x, double y) { this.x = x; this.y = y; } public String toString() { return "("+ me + ")(" + x+"," + y + ")"; } }Program a subclass of PointOfPlane, PointOfSpace, which adds the third dimension z, to the inherited two dimensions x and y. PointOfSpace-objects are constructed by:
Program only the necessary elements into the class PointOfSpace. You are not allowed to make any changes in the class PointOfPlane.
(17 points)
(16 points)
When the program has created a "dictionary" of words, then it offers the translation service: When the user writes a word in the original language, the program either gives the translation or informs that the asked word is unknown. Design and program by yourself, how the program ends.
If you wish, you are allowed to use (but it is not obligatory!) to use an instance of the class HashMap<K,V> as the data structure. If you do not use it, you may assume that there are not more than 10000 pairs of words in the input file. If you decide to use the HashMap<K,V>, this part of its API might be useful:
public HashMap<K,V>() Constructs a new HashMap with the mapping from type K to type V.
(17 points)