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



Home Answers Viewqa Java-Beginners please iam stuck
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


allo
please iam stuck
2 Answer(s)      5 years and 9 months ago
Posted in : Java Beginners



Advertisement
View Answers

January 28, 2009 at 4:26 AM


Hi allo

Here is your solved code..

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 28, 2009 at 4:26 AM


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();
}
}

Thanks...


Related Tutorials/Questions & Answers:
please iam stuck - Java Beginners
please iam stuck  please help i dont find the errors to fix my home wrok this is the program :::: import java.util.*; import java.util.Scanner; class Bell{ String name; double price; int number; String day
Advertisements
actullay iam week in programming logic , and than iam not getting how to trace the programming while excuting time ..
actullay iam week in programming logic , and than iam not getting how to trace the programming while excuting time ..  how to find the auto widening and explicit narrowing? and than what's the difference between auto widening
actullay iam week in programming logic , and than iam not getting how to trace the programming while excuting time ..
actullay iam week in programming logic , and than iam not getting how to trace the programming while excuting time ..  how to find the auto widening and explicit narrowing? and than what's the difference between auto widening
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
please answer me
please answer me  iam using html in select tag.in this one option i selected and that option data will be display in table.And use servlet with html and how to retrieve the data from data base
java please please help
java please please help  Dear Friends plz help me to complete this program import java.util.*; public class StringDemo { static String a="{a=100;b=200;c=300}"; public static void main(String args
how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL
how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL  <html> <head> <title>online exam</title> </head> <body> <div
how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL
how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL  <html> <head> <title>online exam</title> </head> <body> <div
please help
please help  please send me the code of dynamic stack in java without using the built in functions
Define please!?!
Define please!?!  What is tree map sort
please - Java Beginners
please   it did run in one of my friend computer but not mine bcoz she has editor iam running my code using Dos so can you send me the softwere of a good editor thanks for ur help my email is alaa-sg@hotmail.com 
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
Please Help
Please Help  How do I create an attribute that represents the following: A grayscale ‚??color‚?? value, that is, an integer between 0 and 255 inclusive, where 0 corresponds to the darkest black and 255 to the brightest white
Please Help
Please Help  How do I create an attribute that represents the following: A grayscale 'color' value, that is, an integer between 0 and 255 inclusive, where 0 corresponds to the darkest black and 255 to the brightest white
Please help
Please help  Problem: Write a program that does addition, subtraction, multiplication and division operation on real numbers. The operation started with a user entered 2 numbers and click one of the operation buttons
Please help
Please help  Problem: Write a program that does addition, subtraction, multiplication and division operation on real numbers. The operation started with a user entered 2 numbers and click one of the operation buttons
please help//
please help//  Number square cube 1 1 1 3 9 27 5 25 125 7 49 343 9 81 729 total 165 1225 ‚?? this is the ouput..;;; i
please help//
please help//  Number square cube 1 1 1 3 9 27 5 25 125 7 49 343 9 81 729 total 165 1225 ‚?? this is the ouput..;;; i
please help//
please help//  Number square cube 1 1 1 3 9 27 5 25 125 7 49 343 9 81 729 total 165 1225 ‚?? this is the ouput..;;; i
please help
please help  public class AllContact extends javax.swing.JFrame { /** Creates new form AllContact */ public AllContact() { initComponents(); try{ Connection1 con =new Connection1(); Connection conobj
help please?
help please?  Define a class named Circle with the following properties: ‚?Ę An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both data fields
help please?
help please?  Define a class named Circle with the following properties: List item ‚?Ę An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
help please?
help please?  Define a class named Circle with the following properties: List item An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
help please?
help please?  Define a class named Circle with the following properties: List item An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
help please?
help please?  Define a class named Circle with the following properties: List item An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
Please HELPP
Please HELPP  The University wants to make a basic graphical display to show how many people received different grades for a piece of work on a module. You are required to write a program in Java that achieves this. The program
help please?
help please?  Define a class named Circle with the following properties: ? An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both data fields
My screen EPAD is broken ...please help
My screen EPAD is broken ...please help   iam in iraq and my screen EPAD is broken ,.please help..can tel me a place to join it to solve this problem ?..Sory
need help...................please
should show in texfield that already create in the web page. I'm really stuck on this area. Please help me. By the way, I'm using access Database and JSP coding...("GET",url,true) xmlHttp.send(null) } else{ alert("Please Select Employee Id
problem in writing coding. Please help me.
like? I'm really stuck on this. Please help me. By the way, I'm using Access...problem in writing coding. Please help me.  Hi sir, my name is Logeswaran. I have problem in writing JSP coding for my university assigments
Advertisements
 

 

 

DMCA.com