1. This is continuation of the previous assignment. Write a program
which takes a bar code represented by a sequence of 0s and 1s
(representing half bar and full bar respectively). The program prints
the ZIP code it represents. It prints an error message if the bar code
is not correct.
2. Write static methods
public static double sphereVolume(double r)
public static double sphereSurface(double r)
public static double cylinderVolume(double r, double h)
public static double cylinderSurface(double r, double h)
public static double coneVolume(double r, double h)
public static double coneSurface(double r, double h)
That compute the volume and surface areas of sphere, cylinder and cone.
Place them into an appropriate class. Then write a program that prompts
the user for the values of r and h, calls the six methods and prints the
results.
3. Define a class Point3D which can define a point in 3D space by taking
x, y and z coordinates. Write a method
double distance(Point3D p, Point3D q)
that computes the distance between two points.