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



Home Answers Viewqa Java-Beginners need someone do it for me plz..people
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


mahamat ali
need someone do it for me plz..people
1 Answer(s)      3 years and 8 months ago
Posted in : Java Beginners


write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99 2.Pepsi 2.00 3.Chips 0.75 prompt the user to choose an item using the number (1,2,or 3) that corresponds to the item, or to enter 0 to quit the application.after the user makes the first selection, if the choice is 0, display a bill of $0.otherwise,display the menu again.the user should respond to this prompt with another item number to order or 0 to quit.if the user types0,display the cost of the single requested item.if the user types 1,2 or 3 add the cost of the second item to the first, and then display the menu a third time.if the user types 0 to quit,display the total cost of the two items;otherwise,display the total for all three selections.save the file as FastFood.java

B. modify the application in Exercise above so that if the user makes a menu selection he or she has already made, ignore the selection-that is,do not add a second price for the same item to the total.the user is still allowed only three entries.save the file as FastFood2.java


Advertisement
View Answers

February 12, 2011 at 5:54 PM


1)FastFood.java:

import java.util.*;
class  FastFood
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        double price=0;
        boolean check=false;
        do{
        System.out.println("1 Cheeseburger");
        System.out.println("2 Pepsi");
        System.out.println("3 Chips");
        System.out.println("0 Exit");


        System.out.print("Enter choice: ");
        int choice=input.nextInt();

            switch(choice){
                case 1:
                    price+=4.99;
                break;
                case 2:
                    price+=2.00;
                break;
                case 3:
                    price+=0.75;
                break;
                case 0:
                check=true;
                break;
            }
        }
        while(!check);
System.out.println("Total Price: "+price);

    }
}


Related Tutorials/Questions & Answers:
need someone do it for me plz..people
need someone do it for me plz..people  write an application that displays a menue of three items in a restaurant as follows: 1.Cheeseburger 4.99... selection he or she has already made, ignore the selection-that is,do not add a second
need someone to do/help with code
need someone to do/help with code  i need someone to do a code for me. It is a restaurant menu that displays a list of 10 food items. A customer inputs what they want to eat and they receive back a total price for the order. Also
Advertisements
Can someone help me with this?
Can someone help me with this?  I have this project and i dont know how to do it. Can someone help me? please? Write a java class named "PAMA..., Multiply, Divide) Help me please! Thanks in advance!   import
Could someone Possibly help me with this
Could someone Possibly help me with this   think of a number and allow the user to guess it import java.util.*; public class ThinkNumber...(); } System.out.println("Correct!!!!!!!"); } } But when the code is run I do
please i want someone to answer me pleeeeeeeeeeeeease...
please i want someone to answer me pleeeeeeeeeeeeease...    Write a JAVA program using 2D array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student. Assume
PLZ Need some help on the 2nd part of this question...Someone please help !!!!
PLZ Need some help on the 2nd part of this question...Someone please help !!!!  write an application that displays a menue of three items... a menu selection he or she has already made, ignore the selection-that is,do not add
help me to do it in jsp
help me to do it in jsp  if we click on a topic it should direct to another page in separate window i need to create a part of the web page which... to insert and update the topics via admin page. pls help me to do
Need someone to check and modify my simple code - Java Beginners
Need someone to check and modify my simple code   How to write a class that contains Variables that hold hourly rate of pay, number of hours worked. Display gross pay, withholding tax, which is 15% and net pay. I have tried
what is java and why do i need it?
what is java and why do i need it?  Hi, Please tell me what is Java and why do i need it? Is it free to download? Also explain me how to write and test my first Java Application? What is the configuration or system requirement
What do I need to do to use a MSSQL-Server with Web-Harvester?
What do I need to do to use a MSSQL-Server with Web-Harvester?  What do I need to do to use a MSSQL-Server with Web-Harvester
do this for me plzz - Java Interview Questions
do this for me plzz  Given the no of days and start day of a month print the calender of that month . Startday will be given as integer... to print in the same line i.e., without printing a newline. 2)You do
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
Java web development, what skills do I need?
Java web development, what skills do I need?  Java web development, what skills do I need
Java web development, what skills do I need?
Java web development, what skills do I need?  Java web development, what skills do I need
could someone help in this ........
could someone help in this ........  dear Sir/Mrs I'll be thankful for helping me on this ....... write a program that reads 10 numbers. find the largest number and count the occurrence of the largest number from a declared
do the combinations in java, pls help me its urhent - Development process
do the combinations in java, pls help me its urhent  import... or condition5) ") p.evaluate(); } } i need the ouput as follows can any one help me: action when condition1 and condition3 action when condition1
Why do the slashes change when the console gives me the error?
Why do the slashes change when the console gives me the error?   ..."; The console gives me back an error saying: java.io.FileNotFoundException: http...(Image.java:120) at java.lang.Thread.run(Thread.java:619) Why do the slashes change
i need to answer this Question but i can't do it probably
i need to answer this Question but i can't do it probably   use the web to locate the lyrics to the traditional song"The Twelve Days of Christmas" the song contains a list of gifts received for the holiday.the list is cumulative
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program that prompts the user to input an integer and the output the number with the digits reversed. For example if the input is 12345, the output should be 54321
inheritance....please help me friends...!!!... this is important project that i have to do it..
inheritance....please help me friends...!!!... this is important project that i have to do it..   Point ................. #x : int #y : int + Point() + Point(xCoordinate:int, YCoordinate:int) + getX() : int + getY() : int
i need latest oracle certified java dumps.. Pleas help me?
i need latest oracle certified java dumps.. Pleas help me?  i need latest oracle certified java dumps.. Pleas help me
need the answer vry urgently..plz help me...[plzzzzzzzz
need the answer vry urgently..plz help me...[plzzzzzzzz  the question... code...hpw to write in eclipse platform....plz plz mail me...to panda.pragnya7@gmail.com/panda_pragnya@yahoo.com...plz plz...help....me..it can change my lyfe
i want to do a project using jsp and servlet....What are all the materials i need to study
i want to do a project using jsp and servlet....What are all the materials i need to study   i want to do a project using jsp and servlet....What are all the materials i need to study ?   Please visit the following
need
need  i need a jsp coding based project plz help me
could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project.
could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project.  could you suggest me that in which area i have to do a project?i want a complete guidence to complete my project
I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my... the anagram on screen or the output file! Please show me whats wrong. Thanks i need a part of the code thats fixed if possible! Heres is the code: import
Social Media Marketing: Do you really need it?
Social Media Marketing: Do you really need it? Social Media Marketing might... like. Also, because a lot of people present on social networks trend do... that it is always the way to go. There are 3 important things that you need to know before
I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please  * Description* You are hired to develop a laptop inventory information... in MySQL. For this purpose you will need to use the sheridancollege database we
What Security Functions Do You Need for Ecommerce?
What Security Functions Do You Need for E-commerce? It is very important... of the company but also for the security of the customers. These clients need... functions that any businessperson requires to keep information safe. Need
What do we need in PHP Database
Part-4 : What do we Need ? Before making any application or program, we need few software that is essential to run PHP and MySQL code. We need three things.... The second thing you need to installed MySQL. It is a database that stores
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone  The Airport Valet Parking Company (AVP) is a company which... information; Bookings for the service need to be made at least 1 day in advance
 

 

 

DMCA.com