// contains all the vector operations that is given in the initialize() list static void operations(int choice) { Vector v1, v2; // switch statement determines what operation the user chose switch (choice) { // adds inputted vectors case 1: System.out.println("Enter the first vector:"); v1 = new Vector(); System.out.println("Enter the second vector:"); v2 = new Vector(); v1.addVectors(v2); break; // subtracts second inputted vector from the first case 2: System.out.println("Enter the first vector:"); v1 = new Vector(); System.out.println("Enter the second vector:"); v2 = new Vector(); v1.subtractVectors(v2); break; // finds the magnitude of the inputted vector case 3: System.out.println("Enter the vector:"); v1 = new Vector(); System.out.printf("magnitude: %.3f\n", v1.magnitude()); break; // finds the product of an inputted vector with inputted scalar case 4: System.out.println("Enter the vector:"); v1 = new Vector(); v1.scalarProduct(); break; // finds the dot product of two inputted vectors case 5: System.out.println("Enter the first vector:"); v1 = new Vector(); System.out.println("Enter the second vector:"); v2 = new Vector(); System.out.printf("Dot Product: %.3f\n", v1.dotProduct(v2)); break; // finds the angle between the two inputted vectors case 6: System.out.println("Enter the first vector:"); v1 = new Vector(); System.out.println("Enter the second vector:"); v2 = new Vector(); v1.angle(v2); break; } }