private double convertLiquid (double none2 ,char unit2, char amount2)
{
if (unit == 1)
return (amount * 33.8140227);
else if (unit == 2)
return (amount * 0.001);
if (unit == 3)
return (amount * 1000);
if (unit == 4)
return (amount * 0.00852167911);
if (unit == 5)
return (amount * 4.22675284);
if (unit == 6)
return (amount * 202.884136);
if (unit == 7)
return (amount * 67.6280454);
if (unit == 8)
return (amount * 0.264172052);
if (unit == 9)
return (amount * 1.05668821);
if (unit == 10)
return (amount * 2.11337642);
else
return (none2);
}
public void displayData ()
{
c = new Console ();
title ();
c.println ("Your amount is " + amount + " converted to " + convertLiquid (none2, unit2, amount2));
c.println ("If you want to go back the main menu press 1, if you wish to exit press 0: ");
while (true)
{
try
{
procstr = c.readLine ();
proc = Integer.parseInt (procstr);
if (proc == 1)
mainmenu ();
if (proc == 0)
goodbye ();
break;
}
catch (NumberFormatException e)
{
c.println ("That's not an integer. Please Try Again");
}
}
}
What's wrong with my paremeters? It keeps getting error?