compilation error
Hi my program below is not compiling,when I try to compile it i'm getting the error message "tool completed with exit code 1".The loop has to be at the end of the program can you help me.
Blockquoteimport 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.getDescription()+"\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();
}
}
View Answers
Ads
Related Tutorials/Questions & Answers:
compilation error
compilation error Hi my program below is not compiling,when I try to compile it i'm getting the
error message "tool completed with exit code 1".The loop has to be at the end of the program can you help me.
Blockquoteimport
compilation error - Java Beginners
compilation error class s
{
public static void main(String ar[])
{
int j=0834... this program it is giving an
error as integer number is too large.why? and what
Advertisements
java compilation error - Hibernate
java
compilation error hi, i have made an registration page whosevalues should be inserted into database. i have used hibernate and eclipse it is working fine. but when i make a war file and deploy it using ant and then run
java compilation error - Java Beginners
java
compilation error i have downloaded java software(version 6 update 12) from www.java.com. whenever i try to compile the program using javac command,
error message is displayed
javac is not recognized as an internal
compilation problem
compilation problem struts 2.0 : i have included all 5 jars in lib folder,but its giving
compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
compilation problem
compilation problem struts 2.0 : i have included all 5 jars in lib folder,but its giving
compilation problem that package open symphony doesnot exist ( though i imported it) & cant recognise SUCCESS etc symbol.i think i
java Compilation
java program
compilation time following
error is occur in my system
Note...:unchecked for details.
1
error
so plz send me answer why this
error is coming....
To avoid this
error, specify the type of object you're storing in the collection. So
java Compilation
java program
compilation time following
error is occur in my system
Note...:unchecked for details.
1
error
so plz send me answer why this
error is coming....
To avoid this
error, specify the type of object you're storing in the collection. So
java Compilation
java program
compilation time following
error is occur in my system
Note...:unchecked for details.
1
error
so plz send me answer why this
error is coming....
To avoid this
error, specify the type of object you're storing in the collection. So
compilation fail
compilation fail package jsptube.tutorials.servletexample;
import javax.servlet.GenericServlet;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import
compilation errors
compilation errors package jsptube.tutorials.servletexample;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import
command prompt is compilation is not working
command prompt is
compilation is not working Dear java users can anyone help me to run the program in command line prompt i tried by selecting... helloworld through command prompt class not found
error and class loader not able
Error-
Error- Hello, I would like to know about XSD file.
I try to print XML file but I am getting
error SAXException-- says
Content is not allowed in prolog.
Please help me
error
error i have 404
error in my program plz tell me yhe solution about
error
error i have 404
error in my program plz tell me yhe solution about
error
/ServletUserEnquiryForm.shtml
getting an
error given below
SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax
error
please suggest
Error
Error I have created ajax with php for state and city. When I change state then city will not come in dropdown list and it give me
error as 'Unknown Runtime
Error'.
This
error come only in IE browser, but in other brower
error
error When I deploye the example I have this message
cannot Deploy HelloWorld
Deployment
Error for module: HelloWorld:
Error occurred during deployment: Exception while deploying the app [HelloWorld
error!!!!!!!!!
error!!!!!!!!! st=con.createStatement();
int a=Integer.parseInt(txttrno.getText());
String b=txttname.getText();
String c=txtfrom.getText();
String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!! st=con.createStatement();
int a=Integer.parseInt(txttrno.getText());
String b=txttname.getText();
String c=txtfrom.getText();
String d=txtto.getText
error!!!!!!!!!
error!!!!!!!!! st=con.createStatement();
int a=Integer.parseInt(txttrno.getText());
String b=txttname.getText();
String c=txtfrom.getText();
String d=txtto.getText
Error
Error Hi. I am getting
error in the following code after the line I have commented as
ERROR. How to solve this. Thanks in advance.
package...;");
//
ERROR
out.println(" var pattern
Error
Error Hi. I am getting
error in the following code after the line I have commented as
ERROR. How to solve this. Thanks in advance.
package...;");
//
ERROR
out.println(" var pattern
Error
Error Hi. I am getting
error in the following code after the line I have commented as
ERROR. How to solve this. Thanks in advance.
package...;");
//
ERROR
out.println(" var pattern
Error
Error Hi. I am getting
error in the following code after the line I have commented as
ERROR. How to solve this. Thanks in advance.
package...;");
//
ERROR
out.println(" var pattern = /^\d{3,5
error
error whats the
error..............
import java.util.Scanner;
public class g {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int d,x,y;
System.out.println("Enter the first number