/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//  Program Name:Converter.java//  Programmer: John Healy//  Date: Mar 08 2004//  Version 1.0//  Description:  set some verables to a value and set some string values//                desplay everything to standard out////  Created by Little John on Mon Mar 08 2004.//  Copyright (c) 2004 __MyCompanyName__. All rights reserved.// ---------------------------------------------------------------------// Programmer: John Healy// Date: Mar 18 2004// Version: 2.0// Description:  a window is created and input is receved from the //               keyboard.  looping is done on having a valid input and //               the contune question.  a caculation is made from the //               recieved inputs from the keyboard and the answer is //               then sent back to the window.// ---------------------------------------------------------------------// Programer:John healy// Date: Mar 24 2004// version: 3.0// discription:  use an array.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/import java.text.*; import javax.swing.*;public class Converter {    public static void main (String [] args)    {                  double[] convertFactor = {0.0178635,0.762615,0.3505080,0.000210526,1.82410};            double answer = 0.0;            double convertAmount = 0.0;                        int menuChoice = 0;                                String Title = new String("Currrency Converter \n");            String choiceOne = new String("Enter 1 to convert Philippines Pesos to USD. \n");            String choiceTwo = new String("Enter 2 to convert Australia Dollars to USD. \n");            String choiceThree = new String("Enter 3 to convert Russia Rubles to USD. \n");            String choiceFour = new String("Enter 4 to convert Zambia Kwacha to USD. \n");            String choiceFive = new String("Enter 5 to convert United Kindom Pounds to USD. \n");            String convertAmountS = new String("The convrted amout is :");            String stringOut = new String("x");            String eMessage1 = new String("You entered incorrect information.  Please try again");            String eMessage2 = new String("You entered a value less then Zero. Please try again.");            String convertQuestion = new String("How much money do you wish to convert? $");            String yesNo = new String("y");            String ynQuestion = new String("Would you like to do another y/n :");		 		  //sets-up object "money" for output as curency            NumberFormat money = NumberFormat.getCurrencyInstance();             do             {                do                 {                   stringOut = Title + choiceOne + choiceTwo + choiceThree + choiceFour + choiceFive;                    menuChoice = Integer.parseInt(JOptionPane.showInputDialog(null,stringOut));                   if(!(menuChoice > 0 && menuChoice <6))                   {                       stringOut = eMessage1;                       JOptionPane.showMessageDialog(null,stringOut);                      }//end if                                           }while(!(menuChoice > 0 && menuChoice <6)); //end while !(fi > 0 && fi <6)                do                 {                    stringOut = convertQuestion;                    convertAmount = Double.parseDouble(JOptionPane.showInputDialog(null,stringOut));                    if(!(convertAmount > 0))                    {                       stringOut = eMessage2;                       JOptionPane.showMessageDialog(null,stringOut);                     }//end if                }while (!(convertAmount > 0)); //end do---while !(fum > 0)                                stringOut = convertAmountS + money.format(convertFactor[menuChoice-1] * convertAmount);                JOptionPane.showMessageDialog(null,stringOut);                stringOut = ynQuestion;                yesNo  = JOptionPane.showInputDialog(null,stringOut);            }while(yesNo.equals("y") || yesNo.equals("Y"));// end do -- while yesNo != "y" || yesNo != "Y"            System.exit(0);    } // end main} // end class Converter	 
