details of my program

details of my program

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
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
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
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
ModuleNotFoundError: No module named 'my_print_haha_program'
ModuleNotFoundError: No module named 'my_print_haha_program'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'my_print_haha_program' How to remove the ModuleNotFoundError
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
How to retrieve kernal memory details(paged and non-paged ) using SIGAR API in java program
How to retrieve kernal memory details(paged and non-paged ) using SIGAR API in java program  I need to get all memory details of task manager(OS) in a java program. Physical memory details, kernal memory details and Handles
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
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
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
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
ModuleNotFoundError: No module named 'details'
ModuleNotFoundError: No module named 'details'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'details' How to remove the ModuleNotFoundError: No module named 'details
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
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... is this my Email Id is: [email protected]
Program
Program  Define an Abstract class DigitalCamera with instance variables like make, model, resolution, etc, and create() to set the details of camera. Use three sub classes for three different makes (eg. Canon, Olympus, Sony
Program
Program  Define Interface Insurance with methods: details()(name, types of services), no. of branches(), No. of customers(), annual_income(). Implement these methods in its Implementation class LIC, National, BajajAlliance
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
program
with three parameters to set the employee details. Create another method called print to display the employee details in below format: "Employee E001
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
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  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

Ads