/**** Review problem on programming object types. The following file contains two Java classes, Point and Vector. Add implementations for the missing methods so that the main method of class Point runs correctly. ********************************************************************/ import java.io.*; import java.util.*; class Point { double x, y, z; public Point() { //---> add code here } public Point(double xx, double yy, double zz) { //---> add code here } public void scan(Scanner s) throws Exception { //---> add code here, to read in a point from the Scanner s } public double distance(Point b) { //---> add code here, to give the distance to Point b } public static void main(String args[]) { Point p = new Point(); Point q = new Point(); Point r = new Point(); System.out.println("Enter the co-ordinates of p, q, and r."); try { Scanner s = new Scanner(System.in); p.scan(s); q.scan(s); r.scan(s); System.out.println("The length of pq is: " + p.distance(q)); System.out.println("The angle pqr is: " + angle(p, q, r)); } catch (Exception e) { } } public static double angle(Point a, Point b, Point c) { Vector v = new Vector(b, a); Vector w = new Vector(b, c); return Math.toDegrees( Math.acos( v.dot(w)/(v.length() * w.length()) ) ); } } class Vector { double x, y, z; public Vector() { //---> add code here } public Vector(double xx, double yy, double zz) { //---> add code here } public Vector(Point p, Point q) { //---> add code here to set up the Vector from p to q } public double dot(Vector w) { //---> add code here } public double length() { //---> add code here } }