program an interface for a futuristic vending machine

program an interface for a futuristic vending machine

program an interface for a futuristic vending machine that serves users hot food and drinks. Users enter input in from a numerical keypad that also contains a handful of letters. The customer will receive a menu and a prompts asking for their selection.

The vending machine needs to keep track of a few things: The customerâ��s order, which consists: 1) entree 2) drink It will need to calculate the orderâ��s total cost. After the entree and the drink is selected, the machine will repeat the order to the customer and display the total price. Step 1: Create a class to keep track of the customerâ��s order. Provide getters and setters for the entr�©e and drink. Provide a method that calculates the total of the order Provide a method that prints the Entree menu Provide a method that prints the Drink menu Provide a toString() method that returns a String in the following form: Your total for ENTEREE and DRINK is: ORDERCOST Example: Your total for salad and juice is: $2.50

Step 2: Main method & Scanner To allow users to enter input we will be using an instance of the Scanner class. The Scanner class is not a class available by default and must be imported with the import statement: import java.io.Scanner;

Step 2: Menu Prompt The first menu that is printed out for customer is the entree menu. Print this menu to the screen so customer can have a look at their choices. (Use your class method) Then following the menu, ask the customer what entree they would like to order and take in their input. Here is an example of the expected output: Entree Menu 1. Hamburger ($1.50) 2. Cheese Burger ($1.75) 3. Salad ($1.50) 4. Tacos ($1.00) 5. Hotdog ($1.00)

What entree would you like to order? 3 If they fail to enter a valid item prompt them again (use a loop) After the customer orders an entree, proceed to print out the drink menu and ask them which drink they would like to order. Here is an example of the expected output:

Drink Menu 1. Cola ($0.75) 2. Juice ($1.00) 3. Tea ($0.50) 4. Coffee ($0.50) 5. Water ($1.00)

What drink would you like to order? 2 If they fail to enter a valid item prompt them again (use a loop) After both items have been chosen, display the choices selected by the customer. The name of the items should be displayed rather than their numerical value. Ask for confirmation from the customer that this is the correct order. Ask the customer to enter ââ?¬Ë?yââ?¬â?¢ for yes and ââ?¬Ë?nââ?¬â?¢ for no. If the order is correct, display the total cost for the entree and drink. If the order in incorrect then print out to the screen, ââ?¬Å?Have a good day!ââ?¬Â? Sample Output Here's what I got when I ran my main method.

Entree Menu 1. Hamburger ($1.50) 2. Cheese Burger ($1.75) 3. Salad ($1.50) 4. Tacos ($1.00) 5. Hotdog ($1.00)

What entree would you like to order? 3

Drink Menu 1. Cola ($0.75) 2. Juice ($1.00) 3. Tea ($0.50) 4. Coffee ($0.50) 5. Water ($1.00)

What drink would you like to order? 2 Your current order is salad and juice. Is this correct (y/n)? y Your total for salad and juice is: $2.50 Have a good day! Here is an example of the final printout if I decided the order was wrong.

Your current order is salad and juice. Is this correct (y/n)? n Have a good day!

Step 3: Make the Vending machine continue until the users tell it to stop. After: ââ?¬Å?Have a Good Day!ââ?¬Â? Prompt the user to see if they wish to continue: Do you wish to order again (y/n)? If they enter ââ?¬Ë?yââ?¬â?¢ start over with the first menu. If they enter n exit the program.

View Answers









Related Tutorials/Questions & Answers:
ModuleNotFoundError: No module named 'mastercard-vending'
ModuleNotFoundError: No module named 'mastercard-vending'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'mastercard-vending' How to remove the ModuleNotFoundError: No module
program and Interface builder
program and Interface builder  Hi, I'm just getting started in iPhone development, If someone could please suggest a good criterion for when to use a nib to lay out UI elemennts and when to layout the UI elements
Advertisements
producer and concumer Interface program
producer and concumer Interface program  I need producer and concumer Interface program   Hi Friend, Try the following code:ADS_TO_REPLACE_1 import java.util.*; class Multithreading { int val; boolean value = false
pg program in machine learning
pg program in machine learning  Hi, I am beginner in Data Science... program in machine learning Try to provide me good examples or tutorials links so that I can learn the topic "pg program in machine learning". Also tell
machine learning online program
machine learning online program  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: machine learning online program Try to provide me good examples or tutorials links so
machine learning executive program
machine learning executive program  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: machine learning executive program Try to provide me good examples or tutorials
machine learning basic program
machine learning basic program  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: machine learning basic program Try to provide me good examples or tutorials links so
ModuleNotFoundError: No module named 'django-codenerix-vending'
ModuleNotFoundError: No module named 'django-codenerix-vending'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-codenerix-vending' How to remove
program to demonstrate java is machine nutral
program to demonstrate java is machine nutral   can any one give program to demonstrate java is machine nutral
pg program in machine learning and ai
pg program in machine learning and ai  Hi, I am beginner in Data...: pg program in machine learning and ai Try to provide me good examples or tutorials links so that I can learn the topic "pg program in machine learning
pg program in ai and machine learning
pg program in ai and machine learning  Hi, I am beginner in Data...: pg program in ai and machine learning Try to provide me good examples or tutorials links so that I can learn the topic "pg program in ai and machine
upgrad pg program in machine learning and ai
upgrad pg program in machine learning and ai  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: upgrad pg program in machine learning and ai Try to provide me good
pg program in artificial intelligence and machine learning
pg program in artificial intelligence and machine learning  Hi, I am... for the tutorials to learn: pg program in artificial intelligence and machine learning... the topic "pg program in artificial intelligence and machine learning". Also
executive certificate program in artificial intelligence and machine learning
executive certificate program in artificial intelligence and machine learning  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: executive certificate program
professional certificate program in machine learning & artificial intelligence
professional certificate program in machine learning & artificial intelligence  Hi, I am beginner in Data Science and machine learning field. I am... program in machine learning & artificial intelligence". Also tell me which
professional certificate program in machine learning and artificial intelligence
professional certificate program in machine learning and artificial intelligence  Hi, I am beginner in Data Science and machine learning field. I am... program in machine learning and artificial intelligence". Also tell me which
aws training and certification machine learning program
aws training and certification machine learning program  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: aws training and certification machine learning program Try
Connect a linux machine from linux using java program without password
Connect a linux machine from linux using java program without password  Connect a linux machine from linux using java program without password. Can anyone help me
20 Futuristic Technologies that are going to Change the World
already predict a lot of new tech blusters or futuristic technologies in the time to come that are already in the making. Here we would introduce 20 futuristic... to be revolutionized from this futuristic technology. Already personalized
interface
interface   what is the use of marking interface
Interface
Interface  Can Any one Give the exact program explanation for Interface in java? and want to know why they used interface instead of multiple inheritance? Thanks in advance   An interface is one which has abstract
interface.
interface.  Write short note on interface.   Please visit the following link: Java Interface
interface
interface  will the interface implements a interface   Hi Friend, No. Interface can extends another interface but cannot implements it, because interface will not contain the implementation. Thanks
Write an event driven program to perform the arithmetic operations as shown in the interface
Write an event driven program to perform the arithmetic operations as shown... the java programming code for that question. my question is here: Q. Write an event driven program to perform the arithmetic operations as shown
INTERFACE
INTERFACE  how interface support multiple inheritance in java
interface
interface   Hi I have interface in that interface 3 methods are there , after some days client said that,i want to add one more method in that interface ,so how can add 4 method so that the implemented class did not affect
interface
interface  can we extend interface?   Hi Friend, Yes an interface can be extended by other interface like using extends keyword interface A{ } interface B extends A{ } For Example: interface IntefaceA { void
interface
interface  what the use of interface?   An interface is one... variables.Any class can implement(inherit)the interface and make use... is achieved by using the interface (by implementing more than one interface at a time
interface
interface  What is marker interface ?? what is its use in java programming?? is this us in programming ??Explain is implementation with code
interface
interface  develop a library interface which has drawbook(),returnbook()(with fine),checkstatus() and reservebook() methods.all the methods tagged with public
interface
interface  develop a library interface which has drawbook(),returnbook()(with fine),checkstatus() and reservebook() methods.all the methods tagged with public
interface
interface  why do we need interface in java..if it`s usefull for to obtain multiple inheritance in the sense how it gonna be achieved...and i can...)...the y we need interface...THis is question often i heard from my developer
Interface
Interface  I need to implement the interface without overriding its method and also don't use abstract class for this. How to do
interface
interface  What is the exact use of interface in real time scenario? some people says that interface provides multiple inheritance. Is it true...; Through interface, we can achieve the multiple inheritance. Java does
Interface
Interface  1.Create an interface names ShapeInterface that has two... class a.Rectangle that uses the interface b.Circle that uses the interface and abstract class   interface ShapeInterface{ int l=0,b=0; public
Interface
Interface  1.Create an interface names ShapeInterface that has two... class a.Rectangle that uses the interface b.Circle that uses the interface and abstract class   interface ShapeInterface{ int l=0,b=0; public
Interface
Interface  Declare an Interface called property containting a method compute price to compute &return the price.The inerface is to be implemented by follwaing two class (1)Bungalow&(2)Flat both the lasses have following
EJB remote interface
EJB remote interface       The program given below describes  the way of creating a remote interface in EJB. The meaning of Remote interface in terms of Ejb is the java source file
Java Virtual Machine Free Download
Java Virtual Machine Free Download       The Java Virtual Machine is required to run your java program in your computer. The Java Virtual Machine software is freely downloadable from
Java Remote Interface
Java Remote Interface       The Remote interface identifies interfaces whose methods may be invoked remotely from a non-local virtual machine. Any remote object must directly
i have created interface program for simple arithmetic operation but its show some error can i get reason and mistakes
i have created interface program for simple arithmetic operation but its show some error can i get reason and mistakes  import java.io.*; interface... is your code, we have modified it. import java.io.*; interface arith { int a=5
i have created interface program for simple arithmetic operation but its show some error can i get reason and mistakes
i have created interface program for simple arithmetic operation but its show some error can i get reason and mistakes  import java.io.*; interface... is your code, we have modified it. import java.io.*; interface arith { int a=5
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
What is an interface?
What is an interface?  What is an interface
Java Virtual Machine Free Download
Machine is required to run your java program in your computer. The Java Virtual Machine software is freely downloadable from the sun website. To run your program we... Java Virtual Machine Free Download   
Can an Interface implement another Interface?
Can an Interface implement another Interface?   Hi, Can an Interface implement another Interface? Thanks
Can an Interface extend another Interface?
Can an Interface extend another Interface?   Hi, Can an Interface extend another Interface? thanks
ServletRequest interface
ServletRequest interface   What is new in ServletRequest interface
collection interface
collection interface  methods of collection interface and their description with example program?   Please visit the following links: http://www.roseindia.net/java/jdk6/Collection-Interfaces.shtml http
collection interface
collection interface  methods of collection interface and their description with example program?   Please visit the following links: http://www.roseindia.net/java/jdk6/Collection-Interfaces.shtml http

Ads