I have a program that reads into a 24 x 24 array from a *.csv file and I want to use the values to do currency conversions based on using a certain array element. I have defined into my main method the logic to read the *.csv file values into a string value and then parse it into a double value and place them into the array. It looks like the USD_Menu method reads and works with the array elements fine, but if I transfer to one of the other methods, I am getting zeroes when I reference the array elements.
My question is, do I have to pass the array variable to each of the methods as a parameter, or what? I thought that if you define a global variable and populate it, it will have the values necessary for the rest of the program. If I have to pass the array variable as a parameter, how would I do this? I am including the source to my program here for review.
/* This program will allow the user to select a country"s curency and find */
/* what the equivalent is in another. These calculations are based on the */
/* values posted on the www.x-rates.com web site on Thursday, November 18, */
/* 2004. The site had these two items as disclaimers: */
/* 1) "The given values on this site are gathered from the Federal Reserve */
/* Bank of New York, representing the 12 noon buying rates and the */
/* doubleernational Monetary Fund, according to their availability. */
/* 2) Values and dates are believed to be reliable but this site makes no */
/* warranties regarding these values, fitness for a particular purpose, */
/* accuracy or availability." */
/* Written by: Andrew Q. Western */
/* Creation Date: January 13, 2005 */
/* Revision History: January 20, 2005 - Cleaned up the output of the converted */
/* currency value to be only four decimal */
/* places. */
/* January 21, 2005 - Added logic to support the remaining */
/* currency conversions and transfer to and */
/* from their menus. */
import java.io.*; /* This is for the system.io */
import java.util.*; /* This is for allowing user input */
public class CurrencyConv2
{
String Menu_Opt; /* Menu Option */
String Menu_ID;
String Opt_Num;
float Org_Curr_Amt; /* Original Currency Amount */
double New_Curr_Amt; /* New Currency Amount */
String Currency_Desc[] = { "American Dollar (USD) " , "Australian Dollar (AUD) " ,
"Brazilian Real (BRL) " , "British Pound (GBP) " , "Canadian Dollar (CAD) " ,
"Chinese Yuan (CNY) " , "Danish Krone (DKK) " , "Euro (EUR) " , "Hong Kong Dollar (HKD) " ,
"Indian Rupee (INR) " , "Japanese Yen (JPY) " , "Malaysian Ringgit (MYR) " , "Mexican Peso (MXN) " ,
"New Zealand Dollar (NZD) " , "Norwegian Kroner (NOK) " , "Singapore Dollar (SGD) " ,
"South African Rand (ZAR) " , "South Korean Won (KRW) " , "Sri Lanka Rupee (LKR) " ,
"Swedish Krona (SEK) " , "Swiss Franc (CHF) " , "Taiwan Dollar (TVD) " , "Thai Baht (THB) " ,
"Venezuelan Bolivar (YEB) " }; /* Descriptions of each of the currency types to be converted */
String Conv_Factor[][] = new String[24][24];
double Double_Conv_Factor[][] = new double[24][24];
BufferedReader inStr = new BufferedReader(new InputStreamReader(System.in));
Scanner input = new Scanner(System.in);
String line = null;
int row = 0;
int col = 0;
public static void main (String[] arguments) throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
File file = new File("Currency Exchange Rates.csv"); /* Define name of file to read in conversion rates. */
for (a1.row = 0; a1.row < 24; a1.row++)
{
for (a1.col = 0; a1.col < 24; a1.col++)
{
a1.Conv_Factor[a1.row][a1.col] = " ";
a1.Double_Conv_Factor[a1.row][a1.col] = 0.0;
}
}
a1.row = 0;
a1.col = 0;
BufferedReader bufRdr = new BufferedReader(new FileReader(file));
/* Read each line of text file. */
while((a1.line = bufRdr.readLine()) != null && a1.row < 24)
{
StringTokenizer st = new StringTokenizer(a1.line,",");
while (st.hasMoreTokens())
{
/* Get next token and store it in the array. */
a1.Conv_Factor[a1.row][a1.col]= st.nextToken();
a1.Double_Conv_Factor[a1.row][a1.col] = Double.parseDouble(a1.Conv_Factor[a1.row][a1.col]);
a1.col++;
}
a1.col = 0;
a1.row++;
}
/* Close the file. */
bufRdr.close();
a1.USD_Menu();
}
public void USD_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("\nCurrency Conversion");
System.out.println(Currency_Desc[0]+"Conversion Menu\n");
System.out.println("");
System.out.println("A02. USD to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("A03. USD to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("A04. USD to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("A05. USD to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("A06. USD to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("A07. USD to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("A08. USD to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("A09. USD to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("A10. USD to INR Y10. Transfer to INR Conversion Menu");
System.out.println("A11. USD to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("A12. USD to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("A13. USD to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("A14. USD to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("A15. USD to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("A16. USD to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("A17. USD to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("A18. USD to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("A19. USD to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("a10. USD to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("a11. USD to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("a12. USD to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("a13. USD to THB Y23. Transfer to THB Conversion Menu");
System.out.println("a14. USD to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase(); /* Convert the menu option to upper case, just in case */
/* the user entered it in lower case letters. */
Menu_ID = Menu_Opt.substring(0,1); /* Extract the first character of the menu option. */
Opt_Num = Menu_Opt.substring(1,3); /* Extract the last two characters of the menu option. */
int Int_Opt_Num = Integer.parseInt(Opt_Num); /* Convert the last two characters of the menu option to */
/* allow the use of "Case" logic. */
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ))
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 2 || Int_Opt_Num > 24)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "A" ))
{
System.out.print("Please enter your value of " +Currency_Desc[0]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][0];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 2:
{
a1.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc18 = new CurrencyConv2();
cc18.KRW_Menu();
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void AUD_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("\nCurrency Conversion");
System.out.println(Currency_Desc[1]+"Conversion Menu\n");
System.out.println("B01. AUD to USD Y01. Transfer to USD Conversion Menu");
System.out.println("");
System.out.println("B03. AUD to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("B04. AUD to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("B05. AUD to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("B06. AUD to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("B07. AUD to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("B08. AUD to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("B09. AUD to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("B10. AUD to INR Y10. Transfer to INR Conversion Menu");
System.out.println("B11. AUD to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("B12. AUD to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("B13. AUD to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("B14. AUD to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("B15. AUD to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("B16. AUD to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("B17. AUD to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("B18. AUD to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("B19. AUD to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("B20. AUD to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("B21. AUD to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("B22. AUD to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("B23. AUD to THB Y23. Transfer to THB Conversion Menu");
System.out.println("B24. AUD to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase(); /* Convert the menu option to upper case, just in case */
/* the user entered it in lower case letters. */
Menu_ID = Menu_Opt.substring(0 , 1); /* Extract the first character of the menu option. */
Opt_Num = Menu_Opt.substring(1 , 3); /* Extract the last two characters of the menu option. */
int Int_Opt_Num = Integer.parseInt(Opt_Num); /* Convert the last two characters of the menu option to */
/* allow the use of "Case" logic. */
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 2)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "B" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[1]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][1];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void BRL_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[2]+"Conversion Menu");
System.out.println("C01. BRL to USD Y01. Transfer to USD Conversion Menu");
System.out.println("C02. BRL to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("");
System.out.println("C04. BRL to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("C05. BRL to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("C06. BRL to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("C07. BRL to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("C08. BRL to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("C09. BRL to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("C10. BRL to INR Y10. Transfer to INR Conversion Menu");
System.out.println("C11. BRL to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("C12. BRL to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("C13. BRL to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("C14. BRL to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("C15. BRL to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("C16. BRL to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("C17. BRL to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("C18. BRL to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("C19. BRL to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("C20. BRL to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("C21. BRL to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("C22. BRL to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("C23. BRL to THB Y23. Transfer to THB Conversion Menu");
System.out.println("C24. BRL to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 3)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "C" ))
{
System.out.print("Please enter your value of " +Currency_Desc[2]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][2];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc18 = new CurrencyConv2();
cc18.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void GBP_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[3]+"Conversion Menu");
System.out.println("D01. GBP to USD Y01. Transfer to USD Conversion Menu");
System.out.println("D02. GBP to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("D03. GBP to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("");
System.out.println("D05. GBP to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("D06. GBP to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("D07. GBP to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("D08. GBP to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("D09. GBP to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("D10. GBP to INR Y10. Transfer to INR Conversion Menu");
System.out.println("D11. GBP to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("D12. GBP to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("D13. GBP to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("D14. GBP to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("D15. GBP to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("D16. GBP to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("D17. GBP to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("D18. GBP to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("D19. GBP to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("D20. GBP to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("D21. GBP to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("D22. GBP to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("D23. GBP to THB Y23. Transfer to THB Conversion Menu");
System.out.println("D24. GBP to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 4)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "D" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[3]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][3];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc18 = new CurrencyConv2();
cc18.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void CAD_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[4]+"Conversion Menu");
System.out.println("E01. CAD to USD Y01. Transfer to USD Conversion Menu");
System.out.println("E02. CAD to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("E03. CAD to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("E04. CAD to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("");
System.out.println("E06. CAD to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("E07. CAD to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("E08. CAD to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("E09. CAD to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("E10. CAD to INR Y10. Transfer to INR Conversion Menu");
System.out.println("E11. CAD to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("E12. CAD to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("E13. CAD to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("E14. CAD to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("E15. CAD to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("E16. CAD to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("E17. CAD to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("E18. CAD to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("E19. CAD to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("E20. CAD to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("E21. CAD to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("E22. CAD to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("E23. CAD to THB Y23. Transfer to THB Conversion Menu");
System.out.println("E24. CAD to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 5)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "E" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[4]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][4];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void CNY_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[5]+"Conversion Menu");
System.out.println("F01. CNY to USD Y01. Transfer to USD Conversion Menu");
System.out.println("F02. CNY to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("F03. CNY to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("F04. CNY to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("F05. CNY to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("");
System.out.println("F07. CNY to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("F08. CNY to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("F09. CNY to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("F10. CNY to INR Y10. Transfer to INR Conversion Menu");
System.out.println("F11. CNY to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("F12. CNY to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("F13. CNY to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("F14. CNY to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("F15. CNY to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("F16. CNY to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("F17. CNY to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("F18. CNY to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("F19. CNY to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("F20. CNY to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("F21. CNY to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("F22. CNY to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("F23. CNY to THB Y23. Transfer to THB Conversion Menu");
System.out.println("F24. CNY to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 6)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "F" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[5]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][5];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void DKK_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[6]+"Conversion Menu");
System.out.println("G01. DKK to USD Y01. Transfer to USD Conversion Menu");
System.out.println("G02. DKK to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("G03. DKK to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("G04. DKK to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("G05. DKK to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("G06. DKK to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("");
System.out.println("G08. DKK to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("G09. DKK to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("G10. DKK to INR Y10. Transfer to INR Conversion Menu");
System.out.println("G11. DKK to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("G12. DKK to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("G13. DKK to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("G14. DKK to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("G15. DKK to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("G16. DKK to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("G17. DKK to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("G18. DKK to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("G19. DKK to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("G20. DKK to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("G21. DKK to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("G22. DKK to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("G23. DKK to THB Y23. Transfer to THB Conversion Menu");
System.out.println("G24. DKK to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 7)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "G" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[6]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][6];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void EUR_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[7]+"Conversion Menu");
System.out.println("H01. EUR to USD Y01. Transfer to USD Conversion Menu");
System.out.println("H02. EUR to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("H03. EUR to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("H04. EUR to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("H05. EUR to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("H06. EUR to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("H07. EUR to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("");
System.out.println("H09. EUR to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("H10. EUR to INR Y10. Transfer to INR Conversion Menu");
System.out.println("H11. EUR to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("H12. EUR to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("H13. EUR to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("H14. EUR to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("H15. EUR to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("H16. EUR to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("H17. EUR to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("H18. EUR to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("H19. EUR to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("H20. EUR to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("H21. EUR to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("H22. EUR to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("H23. EUR to THB Y23. Transfer to THB Conversion Menu");
System.out.println("H24. EUR to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 8)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "H" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[7]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][7];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void HKD_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[8]+"Conversion Menu");
System.out.println("I01. HKD to USD Y01. Transfer to USD Conversion Menu");
System.out.println("I02. HKD to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("I03. HKD to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("I04. HKD to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("I05. HKD to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("I06. HKD to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("I07. HKD to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("I08. HKD to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("");
System.out.println("I10. HKD to INR Y10. Transfer to INR Conversion Menu");
System.out.println("I11. HKD to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("I12. HKD to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("I13. HKD to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("I14. HKD to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("I15. HKD to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("I16. HKD to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("I17. HKD to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("I18. HKD to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("I19. HKD to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("I20. HKD to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("I21. HKD to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("I22. HKD to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("I23. HKD to THB Y23. Transfer to THB Conversion Menu");
System.out.println("I24. HKD to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 9)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "I" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[8]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][8];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 10:
{
CurrencyConv2 cc10 = new CurrencyConv2();
cc10.INR_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void INR_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[9]+"Conversion Menu");
System.out.println("J01. INR to USD Y01. Transfer to USD Conversion Menu");
System.out.println("J02. INR to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("J03. INR to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("J04. INR to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("J05. INR to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("J06. INR to CNY Y06. Transfer to CNY Conversion Menu");
System.out.println("J07. INR to DKK Y07. Transfer to DKK Conversion Menu");
System.out.println("J08. INR to EUR Y08. Transfer to EUR Conversion Menu");
System.out.println("J09. INR to HKD Y09. Transfer to HKD Conversion Menu");
System.out.println("");
System.out.println("J11. INR to JPY Y11. Transfer to JPY Conversion Menu");
System.out.println("J12. INR to MYR Y12. Transfer to MYR Conversion Menu");
System.out.println("J13. INR to MXN Y13. Transfer to MXN Conversion Menu");
System.out.println("J14. INR to NZD Y14. Transfer to NZD Conversion Menu");
System.out.println("J15. INR to NOK Y15. Transfer to NOK Conversion Menu");
System.out.println("J16. INR to SGD Y16. Transfer to SGD Conversion Menu");
System.out.println("J17. INR to ZAR Y17. Transfer to ZAR Conversion Menu");
System.out.println("J18. INR to KRW Y18. Transfer to KRW Conversion Menu");
System.out.println("J19. INR to LKR Y19. Transfer to LKR Conversion Menu");
System.out.println("J20. INR to SEK Y20. Transfer to SEK Conversion Menu");
System.out.println("J21. INR to CHF Y21. Transfer to CHF Conversion Menu");
System.out.println("J22. INR to TVD Y22. Transfer to TVD Conversion Menu");
System.out.println("J23. INR to THB Y23. Transfer to THB Conversion Menu");
System.out.println("J24. INR to YEB Y24. Transfer to YEB Conversion Menu\n");
System.out.println("Z99. Exit Program");
System.out.print("Option: ");
/* Read in the menu option selected and extract out the different parts of it. */
Menu_Opt = inStr.readLine();
Menu_Opt = Menu_Opt.toUpperCase();
Menu_ID = Menu_Opt.substring(0 , 1);
Opt_Num = Menu_Opt.substring(1 , 3);
int Int_Opt_Num = Integer.parseInt(Opt_Num);
/* Check to see if the user has requested to exit the program. */
if (Menu_Opt.equals( "Z99" ) )
{
return;
}
/* Make sure that the user enters a valid menu option number. */
if (Int_Opt_Num < 1 || Int_Opt_Num > 24 || Int_Opt_Num == 10)
{
System.out.println("Invalid menu option, program is now exiting.");
return;
}
if (Menu_ID.equals( "J" ) )
{
System.out.print("Please enter your value of " +Currency_Desc[9]);
Org_Curr_Amt = input.nextFloat();
New_Curr_Amt = Org_Curr_Amt * Double_Conv_Factor[Int_Opt_Num - 1][9];
System.out.printf("\nYour Equivalent %sis %.4f\n", Currency_Desc[Int_Opt_Num - 1], New_Curr_Amt);
}else if (Menu_ID.equals( "Y" ) )
{
switch (Int_Opt_Num)
{
case 1:
{
CurrencyConv2 cc1 = new CurrencyConv2();
cc1.USD_Menu();
break;
}
case 2:
{
CurrencyConv2 cc2 = new CurrencyConv2();
cc2.AUD_Menu();
break;
}
case 3:
{
CurrencyConv2 cc3 = new CurrencyConv2();
cc3.BRL_Menu();
break;
}
case 4:
{
CurrencyConv2 cc4 = new CurrencyConv2();
cc4.GBP_Menu();
break;
}
case 5:
{
CurrencyConv2 cc5 = new CurrencyConv2();
cc5.CAD_Menu();
break;
}
case 6:
{
CurrencyConv2 cc6 = new CurrencyConv2();
cc6.CNY_Menu();
break;
}
case 7:
{
CurrencyConv2 cc7 = new CurrencyConv2();
cc7.DKK_Menu();
break;
}
case 8:
{
CurrencyConv2 cc8 = new CurrencyConv2();
cc8.EUR_Menu();
break;
}
case 9:
{
CurrencyConv2 cc9 = new CurrencyConv2();
cc9.HKD_Menu();
break;
}
case 11:
{
CurrencyConv2 cc11 = new CurrencyConv2();
cc11.JPY_Menu();
break;
}
case 12:
{
CurrencyConv2 cc12 = new CurrencyConv2();
cc12.MYR_Menu();
break;
}
case 13:
{
CurrencyConv2 cc13 = new CurrencyConv2();
cc13.MXN_Menu();
break;
}
case 14:
{
CurrencyConv2 cc14 = new CurrencyConv2();
cc14.NZD_Menu();
break;
}
case 15:
{
CurrencyConv2 cc15 = new CurrencyConv2();
cc15.NOK_Menu();
break;
}
case 16:
{
CurrencyConv2 cc16 = new CurrencyConv2();
cc16.SGD_Menu();
break;
}
case 17:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.ZAR_Menu();
break;
}
case 18:
{
CurrencyConv2 cc17 = new CurrencyConv2();
cc17.KRW_Menu();
break;
}
case 19:
{
CurrencyConv2 cc19 = new CurrencyConv2();
cc19.LKR_Menu();
break;
}
case 20:
{
CurrencyConv2 cc20 = new CurrencyConv2();
cc20.SEK_Menu();
break;
}
case 21:
{
CurrencyConv2 cc21 = new CurrencyConv2();
cc21.CHF_Menu();
break;
}
case 22:
{
CurrencyConv2 cc22 = new CurrencyConv2();
cc22.TVD_Menu();
break;
}
case 23:
{
CurrencyConv2 cc23 = new CurrencyConv2();
cc23.THB_Menu();
break;
}
case 24:
{
CurrencyConv2 cc24 = new CurrencyConv2();
cc24.YEB_Menu();
break;
}
}
}else System.out.println("Invalid menu option, program is now exiting.");
}
public void JPY_Menu () throws IOException
{
CurrencyConv2 a1 = new CurrencyConv2();
System.out.println("Currency Conversion");
System.out.println(Currency_Desc[10]+"Conversion Menu");
System.out.println("K01. JPY to USD Y01. Transfer to USD Conversion Menu");
System.out.println("K02. JPY to AUD Y02. Transfer to AUD Conversion Menu");
System.out.println("K03. JPY to BRL Y03. Transfer to BRL Conversion Menu");
System.out.println("K04. JPY to GBP Y04. Transfer to GBP Conversion Menu");
System.out.println("K05. JPY to CAD Y05. Transfer to CAD Conversion Menu");
System.out.println("K06. JPY to CNY Y06. Transfer to CNY Conversion Menu");
S