Hi the program below isn't compiling,the program compiles fine without the loop but when I incorporate the loop which is the last part of the program it is not compiling can you help me.
import java.util.*;
import java.text.*;
class HardwareItems
{
String code;
String description;
double price;
HardwareItems(String code,String description,double price){
this.code=code;
this.description=description;
this.price=price;
}
public String getCode(){
return code;
}
public String getDescription(){
return description;
}
public double getPrice(){
return price;
}
public static void main(String []args){
Scanner in=new Scanner(System.in);
double total=0;
ArrayList<HardwareItems> list=new ArrayList<HardwareItems>();
list.add(new HardwareItems("K16","Wood screws,brass,20mm",7.75));
list.add(new HardwareItems("D24","Wood glue,clear,1 liter",5.50));
list.add(new HardwareItems("M93","Sandpaper,fine grade",10.25));
list.add(new HardwareItems("M94","Sandpaper,fine grade",14.75));
DecimalFormat df=new DecimalFormat("$ ##.##");
System.out.println("Hardware Items");
System.out.println();
System.out.println("Code "+" Description "+" Unit Price ");
for(HardwareItems e : list){
System.out.println(e.getCode()+"\t"+e.getDescripti on()+"\t"+df.format(e.getPrice()));
}
System.out.println("place your order!");
System.out.print("NAME:");
String l=in.next();
System.out.print("ADDRESS-1:");
String m=in.next();
System.out.print("ADDRESS-2:");
String n=in.next();
System.out.print("ADDRESS-3:");
String o=in.next();
System.out.print("POST CODE:");
String p=in.next();
System.out.println("Enter Code (XX to stop)" );
System.out.print("Code:" );
String code=in.next();
System.out.print("Quantity: ");
int quantity=in.nextInt();
while(!code.equals("XX")){
System.out.print("Code:" );
code=in.next();
if(code.equals("XX")){
break;
}
System.out.print("Quantity: ");
quantity=in.nextInt();
}
}