program not compiling

Ads
 

program not compiling

Hello can you help me with this program,I am trying to add a loop at the end of the program but it is not compiling,thank you.

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.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

January 27, 2012 at 1:49 PM

Which line you are getting compilation problems and what was the error ?

Chandraprakash Sarathe
http://javaved.blogspot.com/

Ads









Related Tutorials/Questions & Answers:
program not compiling
program not compiling  Hello can you help me with this program,I am trying to add a loop at the end of the program but it is not compiling,thank you. import java.util.*; import java.text.*; class HardwareItems { String code
process of compiling and running java program
process of compiling and running java program  Explain the process of compiling and running java program. Also Explain type casting
Advertisements
Compiling and Running Java program from command line
Compiling and Running Java program from command line - Video tutorial... of compiling and running java program from command line. We have also video... the process of compiling and running the Java program from command prompt
compiling
Compiling package in command line
Compiling package in command line  Hi friends, i am totally new... as an internal or external command, operable program or batch file. please help me how to compile it. Thanks & Regards, Sham   Compiling Java
compiling .class files
compiling .class files  how do i compile .class files using eclipse
ModuleNotFoundError: No module named 'django-compiling-loader'
ModuleNotFoundError: No module named 'django-compiling-loader'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-compiling-loader' How to remove the ModuleNotFoundError
compiling programme IJVM
compiling programme IJVM  I TRY AND COMPILE THE PROGRAMME BELOW BUT HAS ERROR APPEAR ALL THE TIME,,CAN ANYONE CORRECT THE CODE AND WRITE UP THE NEXT METHOD FOR POWER IN THE PROGRAME AS WELL...URGENT // Program to read two single
Compiling and Interpreting Applications in Java
following topics: Compiling Java Program Interpreting Java Program... and then use the command prompt to run the example code. Compiling Java Program For compiling Java program, first your code must write the code using text editor
compiling a uploaed java file - JSP-Servlet
compiling a uploaed java file  How a uploaded java source file is automatically compiled(i.e converted to .class file) in server using jsp/servlet
Compiling Objective C
program on windows and Max OS x machine. Compiling Objective C program is necessary as it generates the executable program that can run. Compiling Objective C... Compiling Objective C     
program
program  write a javascript program to create a application form with validation
program
program  write a html program in show table and this word in box
program
program  write a program different between to dates in terms of days in java
program
program  write a program reversee a string. input-hi this is roseindia output-roseindia is this hi
program
program  develop a servlet to insert the data in the database from our program in the table stored in the database
program
program  WAP a java program to form 1/2+3/4+5/6+7/8 series
program
program  write a java program to input a no. and print wheather the no. is a special no or not. (special no. are those no whose factorial of the sum of digit of the no is same as the original
program
program  how to improve programming skills plss tell some tips..i am understanding concepts but unable to write program so,pls give some guideness plsss
Program
Program  a program to prove that default constructor of super class is available to subclass by default. Define a parameterize constructor for super class to store name = ‚??Tommy‚?? age=‚??23‚?? and call this constructor
Program
Program  a program to create two classes Commercial and Domestic. Override the method calculatebill() of Commercial class(Rs.8 per unit) into Domestic class(Rs 6 per unit) to compute electricity bill for both classes
program
program  no i want a program that shows how merge sort algorithm works in graphical representations like numbers are taken in circles and computation... in rectangles or circles wat ever it may be. the theme of program is to show algorithm
program
program  Write a JSP Program, which displays a web page containing the name of the Courses, Courses being offered currently, number of students enrolled in each course, new courses to be offered, eligibility criteria for taking
program
program  i want a progra in java to print a sentence in alphabetic order, taking the input from the user.the program should writen without using the array for example : if input= this is a cat then output sould = a cat
program
program  Write a JSP Program, which displays a web page containing two web links one for your profiling and other for the schedule of theory of practical classes of your Batch. When one click on link for getting your profile
program
program  Write a program to print details of a week for a particular day using array of objects Integer and String. OUTPUT: First Day of Week is Monday Second Day of Week is Tuesday Third Day of Week is Wednesday Forth Day
i have got error while compiling simple tag handler
i have got error while compiling simple tag handler   javac.servlet.jsp not found! tell me what are the jar files required to run simple tag handler class   The package you have used javac.servlet.jsp does not exist
About running the Applet Program
About running the Applet Program  Hi I have composed an Applet Program and compiled the program, until that it is fine but how to run the Applet program(compiling i typed as javac AppletDemo.java)? Is compiling
About running the Applet Program
About running the Applet Program  Hi I have composed an Applet Program and compiled the program, until that it is fine but how to run the Applet program(compiling i typed as javac AppletDemo.java)? Is compiling
How to compile and run Java program
, For compiling and running the Java program from command prompt you should must have JDK... tutorial Compiling and Running Java program from command line. If Java...How to compile and run Java program  How to compile and Java program
program

Ads