Class PointCPTest

java.lang.Object
  |
  +--PointCPTest

public class PointCPTest
extends java.lang.Object

This class prompts the user for a set of coordinates, and then converts them from polar to cartesian or vice-versa.


Constructor Summary
PointCPTest()
           
 
Method Summary
private static PointCP getInput()
          This method obtains input from the user and verifies that it is valid.
static void main(java.lang.String[] args)
          This method is responsible for the creation of the PointCP object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

PointCPTest

public PointCPTest()
Method Detail

main

public static void main(java.lang.String[] args)
This method is responsible for the creation of the PointCP object. This can be done in two ways; the first, by using the command line and running the program using java PointCPTest <coordtype (c/p)> <X/RHO> <Y/THETA> and the second by getting the program to prompt the user. If the user does not enter a valid sequence at the command line, the program will prompte him or her.
Parameters:
args[0] - The coordinate type. P for polar and C for cartesian.
args[1] - The value of X or RHO.
args[2] - The value of Y or THETA.

getInput

private static PointCP getInput()
                         throws java.io.IOException
This method obtains input from the user and verifies that it is valid. When the input is valid, it returns a PointCP object.
Returns:
A PointCP constructed using information obtained from the user.
Throws:
java.io.IOException - If there is an error getting input from the user.