Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners doesnt run again

Have Programming Question? Ask it here!
 
 
 


allo
doesnt run again
2 Answer(s)      5 years and 6 months ago
Posted in : Java Beginners



Advertisement
View Answers

January 29, 2009 at 10:35 PM


Hi

I am sending u again the code, this code run in my machine properly
---------------------------------------------------------------------------

import java.util.*;
import java.util.Scanner;

class Bell{
String bellName;
double bellPrice;
int bellNumber;
String bellDay;

public Bell(){}

public Bell (String bell_name, double bell_price,int bell_number, String bell_day){
bellName = bell_name;
bellPrice= bell_price;
bellNumber= bell_number;
bellDay= bell_day;
}
}

class Order{
String orderName;
double orderPrice;

public Order(){}

public Order(String order_name, double order_price){
orderName= order_name;
orderPrice= order_price;
}
}

public class Coffee{

public static void main(String[] args){
Scanner in =new Scanner(System.in);
int counter = 0;
double total = 0;
String today = "first";
String orderName[] = {"Tofu Burger","Cajun Chicken","Buffalo Wings","RainbowFillet","Rice Cracker","NoSalt Fries","Zuccini","Browen Rice","Cafe Mocha","Cafe Latte","Espresso","Oolong Tea"};
double orderPrice[] = {3.49, 4.59, 2.99, 2.99, 0.79, 0.69, 1.90, 0.59, 1.99, 1.99, 2.49, 0.99};
Order[] orderObj = new Order[12];
Bell[] bellObj = new Bell[100];

int z;
int per, d;
System.out.print ("\n\tEntree\t");
System.out.print ("\t\tSide Dish\t");
System.out.println("\tDrink");
System.out.print("______________________________________________________________________");



January 29, 2009 at 10:35 PM


do{
do{
do{
for(int i=0; i<=11; i++){
System.out.println ("\n\t" + i + "\t\t\t" + orderName[i] + "\t\t" + orderPrice[i]);
}
System.out.print ("\nEnter your choice:");
int x ;
x=in.nextInt();
int y;
System.out.print ("How many order do you want from it??");
y=in.nextInt();
total+=orderPrice[x]*y;
bellObj [counter]= new Bell();
bellObj [counter].bellName= orderName[x];
bellObj [counter].bellPrice=orderPrice[x];
bellObj [counter].bellNumber= y;
bellObj [counter].bellDay = today;
counter++;
System.out.print ("Do you want another order??if you finish Press 0 ");
z=in.nextInt();
}while(z!=0);
for(int i=0; i<bellObj.length; ++i){
if(bellObj[i]!=null)
System.out.println(bellObj[i].bellName+"\t"+bellObj[i].bellPrice+"\t"+bellObj[i].bellNumber+"\t"+bellObj[i].bellDay);
}
System.out.println("Your Orders cost: " +total);
System.out.print ("is there another person??if No press 0");
per=in.nextInt();
if (per==0){
System.out.println("Thank You for your Interest..");
}
}while(per!=0);

System.out.print ("Start another day??if Yes Press 0");
d = in.nextInt();
if(d==0)
today="second";
}while(d!=0);

System.out.print ("Yor bell is: ");
for(int i=0; i<bellObj.length; ++i)
in.close();
}
}


Related Tutorials/Questions & Answers:
doesnt run again - Java Beginners
doesnt run again  the code u sent doesnt run and the error msg says illegal start with do even if i change it it keeps telling me the same... the soltion   Hi I am sending u again the code, this code run in my
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?  **struts.xml** <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software
Advertisements
There and Back Again
There and Back Again       The weblog of Joshua Eichorn, AJAX, PHP and Open Source Read full Description
again java - Java Beginners
again java  Hi, i will ask iam using servlets ,in one program my requirement is if there is a image(if u like) in anywhere and we browse...){e.printStackTrace();} } } } my problem is how to compile,run and where to see o/p
java again - Date Calendar
java again  I can't combine your source code yesterday, can you help me again. My problem is how we get result jtextfield2 from if jtexfield1 we...[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run
again with xml - XML
again with xml  hi all i am a beginner in xml so pls give me the details regarding the methods used in it. wat will return the methods getElementsByTagName(), getChildNodes(), getParentNode(), nextSibling(),etc and when
again java - Java Beginners
again java  i will ask iam using servlets ,in one program my requirement is if there is a image(if u like) in anywhere and we browse that image and it is store in u r account like orkut. my doubt is if the image is stored
hi again - Java Beginners
(this); t.start(); } public void run(){ try { Thread.sleep(10); System.out.println...; MyThread1(String s2){ s1=s2; t=new Thread(this); t.start(); } public void run
Hi .Again me.. - Java Beginners
Hi .Again me..  Hi Friend...... can u pls send me some code on JPanel.. JPanel shoul have 1pic 1RadioButton .. Like a Voter List...() { public void run() { createAndShowGUI
matching database again - Java Beginners
matching database again  Dear experts, So happy I get through this ask a question page again. Thank God. I want to say "A BIG THANK YOU" for helping me about the matching codes. It is working now after fine tuning
Read data again - Java Beginners
Read data again  sir, i still hav a problem,first your code will be change like this : in netbeans out message error 5. Can you help me again. My database like my question before.Can you fix and find the problem in my code
Read data again - Java Beginners
Read data again  Hey, i want to ask again about how to read data from txt, My DB: kd_div varchar(15), nm_div varchar(30), dep varchar(25), jab varchar(35), cab varchar(15), ket varchar(30) My data in txt file is://i
Hi..Again Doubt .. - Java Beginners
Hi..Again Doubt ..  Thank u for ur Very Good Response...Really great.. i have completed that.. If i click the RadioButton,,ActionListenr should get call. It should add to the MS Acess table..Plz check this out.... hope u ill
call frame again - Java Beginners
can run ,first i have one frameA in this frame have one jTextfield1,one...() { public void run() { new FrameA1().setVisible(true
help again plz sorry - Java Beginners
help again plz sorry  Thanks for giving me thread code but i have...; t=new Thread(this); t.start(); } public void run(){ try { Thread.sleep..., Please change some code, public void run(){ try{ Thread.sleep(10
Drop Down Reloads again in IE..How to prevent this?
Drop Down Reloads again in IE..How to prevent this?  Hi i was using two drop down box..One for Displaying date followed by another for Dispalying Month..If i Select/Change Month from the 2nd drop down then the 1st drop down
Script on the page used too much memory. Reload to enable script again.
Script on the page used too much memory. Reload to enable script again. ... to enable script again". After getting this error other pages also not working. Logout and login again not working. if open the new tab then only working other
how to run rmi program
how to run rmi program  how to run rmi program
run php code online
run php code online  Is it possible to run PHP Code online
the last data entered into database is getting stored again after refreshing
the last data entered into database is getting stored again after refreshing  hey all i made a shout box using php and mysql but the last data entered into the DB is getting retrieved again as i refresh the page.. even
best os to run java
best os to run java  which is best os to run java program
Java run time polymorphism
Java run time polymorphism  What is run-time polymorphism or dynamic method dispatch
Run time polymorphism
Run time polymorphism  What is run time polymorphism or dynamic method dispatch
Needs to Run - Struts
Needs to Run  What are the Fundamentals to Run a Struts Applications
Run XML file
Run XML file  Hi.. How do I execute or run an XML file? please tell me about that Thanks
run project on company lan
run project on company lan  sir, i have create dynamic java project of complaint registration and run on local host http://localhost:8080 and by using ip adress but the problem is how to run it at on company server so
how to run this program?
how to run this program?  how to run java swing program   Java Swing program runs same as a simple java program. There is no difference... with javac and run with java command, same as a simple java program. Learn Swing
Run time error - WebSevices
Run time error  Hello, Anyone know, how run the template files in zend framework.Anybody help me. Rgds, Pras  code to help in solving the problem : protected function _run($template
java not run on my pc
java not run on my pc  i have installed java in pc but when i run and compile any program the massage is display that 'javac' is not recognized as an internal or external command
how to run servlet
how to run servlet  Servlet run procedure for J2EE Software   Hi Friend, Please visit the following links: http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml http://www.roseindia.net/servlets
Run time exception
Run time exception  What class of exceptions are generated by the Java run-time system?  Java runtime system generates RuntimeException and Error exceptions
submitting corect user and passowrd, it again comes on login.jsp - Struts
submitting corect user and passowrd, it again comes on login.jsp  i am submit username and password in login.jsp, after submit correct username and password, it again come in login.jsp. Here some files: Struts.xml
j2me pgrm run
j2me pgrm run  How to run a j2me program   Please visit the following link: J2ME Tutorials
how to run - Java Beginners
how to run   how to run java program... brifely  Hi... to execute or run the program. For ex, If you have the following java program... file on the command prompt using: "javac HelloWorld.java". And then run it using
How to compile and run the JSP
How to compile and run the JSP  Hi Kindly tell me how to run and compile JSP small Program using Tomcat as webserver. I created small program HELLO JSP in HTML and compile the program but it is saying Class o r interface
Run a simple EJB code
Run a simple EJB code  I found the code this. However, as I have no idea with EJB, I can't understand how to run it. Can anybody help me by giving steps (by giving snapshots or writing full procedure)how to run it (any platform
Run a simple EJB code
Run a simple EJB code  I found the code this. However, as I have no idea with EJB, I can't understand how to run it. Can anybody help me by giving steps (by giving snapshots or writing full procedure)how to run it (any platform
run exe on remote client
run exe on remote client  I am making a client server application using netbins 6.1 , Jsp servlet, Mysql5.1... I want to run an batch file or exe... copied files fromserver to client using my application but i cant run it on remote
Need a query to run in db2
Need a query to run in db2  hi all, I need a query to run in DB2 for the following: Table 1- MARKETINGACCOUNTS Fields-ACCOUNTTYPE,Accountnumber; Table 2- ACCOUNTS Fields-LEDGERCODE,ACCOUNTNUMBER,BALANCE FROM THE ABOVE I NEED
compile and run java program
compile and run java program  Hello, everyone!!! I just want to ask if you anyone here knows how to compile java file in linux specifically UBUNTU... do I compile and run this file using the terminal of ubuntu... By the way, I am
run jsp file
run jsp file  how to run the jsp file in varies web servers   Hi Friend, For Apache Tomcat,there is a basic directory structure: webapps-Web Application Folder- WEB INF-classes You have to set the class path also
get integer at run time
get integer at run time  how to get integer value at run time in j2ee using servlets   Hi, You can get the value from request parameter and then convert using the function Integer.parseInt(variable). Here
how to run java program
how to run java program  i have jar file. in jar i have so many classes.in one of file i want modify .after modifying file i want replce in jar. please help me to how to generate class and how to replace
Run time problem
Run time problem  when i run a project,it shows an exception like "unable to create MIDlet".It also shows "running with locale:English_united States.1252 running in the identified third party security domain" "please help
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
java pages run
java pages run  how do we run jsp file in the browser. do we need to install server. could it be run on the xamp server   You need Apache Tomcat Server to run the jsp code over it. Follow these steps to run the simple
couldnt run this program
couldnt run this program  package calculator; import java.util.Scanner; public class calculator{ public static void main(String args[]){ Scanner vin = new Scanner(System.in); Double firstnum,secondnum,sum,sub,mul
how to run applet - Applet
how to run applet   Hi everybody i am using connecting jdbc in applet program. this is executed successfully with appletviewer command >appletviewer -J-Djava.security.policy=A0.txt A0.html but cannot in browser
Advertisements
 

 

 

DMCA.com