Not sure is i was to clear with what is sed.
here is my is code so for
import javax.swing.*;
public class Garden
{
static String product, item, ordered,s, l, g, w, e;
static double SAND=14.45, GRAVEL=16.75, LOAM=17.20;
int s, l, g, w, e;
public static void main ( String [] args )
{
enterProduct();
askAmount();
System.exit( 0 );
}
public static void enterProduct()
{
product = JOptionPane.showInputDialog( "BEDROCK LANDSCAPE SUPPLIERS \n\n S:Sand \n L: Loam \n G: Gravel \n W: Woodchips \n\n\n E: End \n Enter Supply Code" );
item= product + item;
while ( !product.equals( "e" ) )
{
product = JOptionPane.showInputDialog( "BEDROCK LANDSCAPE SUPPLIERS \n\n S:Sand \n L: Loam \n G: Gravel \n W: Woodchips \n\n\n E: End \n Enter Supply Code" );
item = product + item;
}
}
public static void askAmount()
{
if(product ="s")
temp=JOptionPane.showInputMessage(null,"How Much Sand do you want?");
ordered=Double.parseDouble(temp);
ordered= SAND * ordered;
}
else
{
if(product = "g")
ordered=Double.parseDouble(temp);
ordered= GRAVEL * ordered;
}
}
}
trying to use what was entered in the first string to ask for amount ordered the work out total.
thanks