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; 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/









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... to explain you the process of compiling and running the Java program from command
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
Compiling Error - Java Beginners
Compiling Error  cant able to compile java servlet file in the command prompt? WHY? but i can compile normal java file give me answer to fix my problem
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 a Servlet - JSP-Servlet
Compiling a Servlet  Respected sir, I just want to know how to compile a servlet coding? I need it in a sequential way so that I can understand it at the very first time as I am new to this technology
error while compiling - Java Beginners
error while compiling  i am facing problem with compiling and running a simple java program, can any one help me, the error i am getting is javac is not recognised as internal or external command  Check if you JAVA_HOME
Compiling Error - Java Beginners
Compiling Error  cant able to compile java servlet file in the command prompt? WHY? but i can compile normal java file give me answer to fix my problem.  Hi Friend, Do you have servlet-api.jar in the lib folder
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
Error While Compiling - Java Beginners
Error While Compiling  Hi All I Am a beginner and i face the following problem while compiling can anyone help me. C:\javatutorial\example>... command, operable program or batch file. C:\javatutorial\example>  
error in compiling j2me apllication - Applet
error in compiling j2me apllication  hi, in my j2me application for video,m getting only the audio.i ll send the code. package src.video_streaming; import javax.microedition.media.Manager; import
Compiling and Interpreting Applications in Java
following topics: Compiling Java Program Interpreting Java Program For this tutorial you can use any text editor for writing the Java program..._TO_REPLACE_1 For compiling Java program, first your code must write the code using
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
program
program  any program of hotel or school management
program
program  program of jdbc using ms access for creating table
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  WAP a java program to form 1/2+3/4+5/6+7/8 series
program
program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers
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
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   An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes
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  Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder
program
program  explanation of program on extending thread class   Hi Friend, Please go through the following link:ADS_TO_REPLACE_1 Java Threads Thanks
program
program  Develop a program that computes the distance a boat travels across a river, given the width of the river, the boat's speed perpendicular to the river, and the river's speed. Speed is distance/time, and the Pythagorean
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  . Develop a program that accepts an initial amount of money (called the principal), a simple annual interest rate, and a number of months will compute the balance at the end of that time. Assume that no additional
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  Utopias tax accountants always use programs that compute income taxes even though the tax rate is a solid, never-changing 15%. Define the program calculateTax which determines the tax on the gross pay. Define
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
program
program
program
program

Ads