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



Home Answers Viewqa Java-Beginners details of my program
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


allo
details of my program
2 Answer(s)      5 years and 10 months ago
Posted in : Java Beginners



Advertisement
View Answers

January 29, 2009 at 6:22 AM


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


Related Tutorials/Questions & Answers:
details of my program - Java Beginners
details of my program  hi 1- allow the customer to order any thing... array but it could make the program much longer note: i want to use the method... stupid alittle bit but this is my home work  import java.util.
program on employee details
program on employee details  to write a program on displaying the employee details like empid,empname,wonno,location,leave type by using the text fields in java swings
Advertisements
to write a program to display the employee details..
to write a program to display the employee details..  To dipslay the employee details like empid,empname,salary,wonno bye using java swings.by running this program the new window has to be opened asking us to enter all
Write a program to get student details and store in a database
Write a program to get student details and store in a database  Write a program to get student details and store in a database
Java Program MY NAME
Java Program MY NAME   Write a class that displays your first name vertically down the screen where each letter uses up to 5 rows by 5 columns of a character input by you with a blank line between each letter. Note: each letter
My first Java Program
My first Java Program  I have been caught with a practical exam to do the following: Write a program that takes input from a user through the command line. The user must be prompt to enter a sentence (anything). The sentence
My first struts 2 program
from one page to another. Details: I am trying my first Struts 2 example program. I want to pass values from first loginpage.jsp to displaypage.jsp. I...My first struts 2 program  Hi, Please help me for my first struts 2
java program for me to see who are on my server
java program for me to see who are on my server  Hello, Im a beginner in java, doing some tutorials and stuff. I wanna write a java program to put on my server where i wanna see if like 3 people are on my server PLUS that i want
I need add my java program with a picture.
I need add my java program with a picture.  Good evng Frnds Friends i created 1 jar file in my desktop. I need add this program with 1 picture. Whenever the user double clicking on that picture The program must start instead
doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser with the help of standard widget toolkit(swt) and java. i creted some buttons such as GO,REFRESH,STOP.... on which the name is not apppeared as GO,STOP...but the name
Why is my program running an infinite loop? Parallel Arrays Program
Why is my program running an infinite loop? Parallel Arrays Program  Calculate and print the average (this works) Search for Joel in the list, print his data----for some reason this is outputting the wrong data and is outputting
i have problem in that program to my assignment sir - JavaMail
i have problem in that program to my assignment sir   Develop a programmer's editor in Java that supports syntax-highlighting, compilation support, debugging support, etc
how to use yield(),join() methods in program.where it is usefull in my program
how to use yield(),join() methods in program.where it is usefull in my program  Hi i am using yield() in my program but the out put i can't... thread with same priority .but in my example i can't findout exact function
how to use yield(),join() methods in program.where it is usefull in my program
how to use yield(),join() methods in program.where it is usefull in my program  Hi i am using yield() in my program but the out put i can't... thread with same priority .but in my example i can't findout exact function
student details
student details  create an application for details of 1st to 5th standard students by using loops and scanner
student details
student details  hi sir/madam i have a doubt in PHP how to insert student details using mysql with php..   Have a look at the following link: PHP Mysql insert
scjp details
scjp details  SCJP fees details abou scjp? What are the best books for preparing to scjp? How many time scjp exam's are conducted for one year
customer details
customer details  write a java code to enter n number of persons details(name,address,phone number) in a array list. Also consider exceptional cases like entering integer in name,character in phone number. use try,catch ,throw
APLIANCE DETAILS
APLIANCE DETAILS  I have created a package named ApplianceDetails that contains the Appliance class. Now I want to create a class named NewAppliance that stores the details of the newly launched appliances.I used the following
bank details - JSP-Servlet
bank details  hi i just need a coding for bank details... since iam working as a trainee my leader gave me task like this.. What he want me to do is first to set the user account details in database, and the to create a login
how to code-updating some details n some details r unchanged
: bloodgroup : my requirement is to update the details of user. and i had written the update query,but with that query all the details are updating... my doubt...how to code-updating some details n some details r unchanged  i have
searching inside a file for details
searching inside a file for details  i created a file with name,country,state etc...when i'm searching for the name, i have to get other details like country,state etc...please do help
my project
my project   how to creat a e learnig site with student information , faculty details , student queries , student feedback, course information
j2ee environment varaiable details
program hello world it show several error.please tell me the what is the environment variables i have changed. the program i typed is import javax.sevlet.
Employee Details - JSP-Servlet
. Will it work for me. Will it be executing according to my requirement. If yes,I will try... in a crying situation.. Hope ROSEINDIA TEAM will understand my problem...(insertion or deletion or etc.,) is successfull or not. So to my knowledge
how to access the details - Java Beginners
) { ... ... .... } public String... no)and retrive all the details of the person which is not given. Please write the program
my question
my question   "Write a C/C++ program to show the stored procedure PROCRESETMAIL" on database "USER_NOTIFY
my question
my question   "Write a C/C++ program to show the stored procedure PROCRESETMAIL" on database "USER_NOTIFY
Retrieval column details into respective JComboboxs
Retrieval column details into respective JComboboxs   Hello sir, As of now i created program in the Eclipse the GUI window .I had creaated the GUI window & also i had created the table in MSSQL the differet columns
How to extract details from XML? - JSP-Servlet
How to extract details from XML?  I want to extract details from http://service.openkapow.com/palanikumar/airportantigua.rest How can i extract details from this link?Here is my program... Airport
my assignment
my assignment  as programmer, you have been assigned to develop... base on the menu listed and the price will be counted.in addition, the program......this is my assignment....plz
 

 

 

DMCA.com