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



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

Have Programming Question? Ask it here!
 
 
 


mahamat ali
need someone do it for me plz..people
1 Answer(s)      3 years and 2 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
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
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
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
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 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 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
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
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
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
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
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
Fashion Accessories: Why do you need them?
Fashion Accessories: Why do you need them? It is pretty obvious why you would..., but the need for all sorts of fashion accessories doesn't come as a simple idea... to make an outfit look better than it did before, you need to know exactly what
need
and move that click to specified co-ordinates.please reply to me
need
and move that click to specified co-ordinates.please reply to me
Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks
Need some help urgently
Need some help urgently  Can someone please help me with this below question. I need to write a class for this. If you roll Y standard six-sided dice... need to write a class for this where X and Y are passed as parameter. If someone
Need of ORM
Need of ORM  Why do you need ORM tools like hibernate
do the following
do the following  write a program to enter the string and do the following 1- count totle number of vowel 2- replace vowel 3- delete the charactor from given value 4- riverce the string 5- convert second word in upercase 6
The while and do
While and do-while      ... that the condition becomes false and the loop terminates. Have a look at do-while statement now. Here is the syntax: do { statement(s
how to do this?
how to do this?   Given any integer 2D array, design then implement a Java program that will add to each element in the array the corresponding column number and the corresponding row number. Then, it prints the array before
help me
help me  HI. Please help me for doing project. i want to send control from one jsp page to 2 jsp pages... is it possible? if possible how to do
I need to develop a gui like this
field Gained focus. then the list appear with some string values...someone please help me   sorry goes through this link I need to develop like...I need to develop a gui like this  Hai Friends, I need to develop
Need Project
Need Project  How to develop School management project by using Struts Framework? Please give me suggestion and sample examples for my project
need to Program
need to Program   Can any one help me on below How to insert more then one records in EXCEL Sheet using JSP
help me
help me  Hi I'm loges. I'm doing my final year project now, I have some problem in my project and i need some help on it. NowI'm doing a site... button, and nationality I'm using dropdown list. Please help me. your kindness
help me
the flow of people , cars , airplanes , transactions , and so on . write a program... by pressing a key. you will need to determine how the customer will decide which line... in the beginning will ake the uesr to which system he/she wants to be transferred. plz
Need help
Need help  Dear sir, I have a problem. How to write JSP coding, if a user select a value from drop down list for example department, the another drop.... This name list should get from the database. Please help me. By the way, I'm
help me
help me  i have done as u directed but nothing happens gud to me..... . i am using netbeans is that matter at all help me and take me out from trouble where to store jfree api to use it for j2ee based project
help me
help me  hi sir pls tell me how to use ajax form validatin from very simple way with two ot three text field pls help me use ajax in php my email id is:- rohit11tripathi@gmail.com pls sir give me some vasic information i know
help me
help me  please send me the java code to count the number of similar words in given string and replace that word with new one
help me..
help me..   what are the component needed by grid computing, cloud computing and ubiquitous computing? discuss about the security of above computing. difference between that 3 computing
 

 

 

DMCA.com