Write an applet that simulates a soft drink machine.

Assignment Help JAVA Programming
Reference no: EM13940805

Write an applet that simulates a soft drink machine. The simulated machine dispenses the following soft drinks: cola, lemon-lime soda, grape soda, root beer, and bottled water. These drinks cost $0.75 each to purchase.

When the applet starts, the drink machine should have a supply of 20 of each of the drinks. The applet should have a text field where the user can enter the amount of money he or she is giving the machine. The user can then click on a button to select a drink to dispense. The applet should also display the amount of change it is giving back to the user. The applet should keep track of its inventory of drinks and inform the user if he or she has selected a drink that is out of stock. Be sure to handle operator errors such as selecting a drink with no money entered and selecting a drink with an inadequate amount of money entered.

Reference no: EM13940805

Questions Cloud

Event management strategic plan : Students are reminded that this report should focus upon the event management strategic plan rather than the stakeholders or event owners' external mission, vision, goal, objectives, values and outcomes.
Background reading in the areas of recruitment : This learning module requires you to do background reading in the areas of recruitment, selection and induction. This reading will provide you with the conceptual foundations needed to do the practical assessment tasks.
Identify the key features of the changing business : Identify the key features of the changing business and economic environment in the Asian Pacific region and critically assess the likelihood of countries in this region signing a single free trade agreement.
What irregularities should a fraud examiner look : What irregularities should a fraud examiner look for in a firm's fixed assets?
Write an applet that simulates a soft drink machine. : Write an applet that simulates a soft drink machine. The simulated machine dispenses the following soft drinks: cola, lemon-lime soda, grape soda, root beer, and bottled water. These drinks cost $0.75 each to purchase.
Is the cocaine sentencing law discriminatory : Should judges be allowed to consider special circumstances such as marital status, employment status and education when sentencing defendants?
Interaction between marketing and revenue management : Describe how Porter's five forces analysis can be used as part of a revenue management strategy. Discuss the interaction  between marketing and revenue management , with particular reference to market segmentation distribution channels  and the 7Ps
Write a section on the hr section within the case study : Write a section on the HR section within the case study? Such as there were 3 leaders at the top, and how that had an impact on the communication.
Structure for the report and marking scheme : Your work should comprise on report detailing your research (the report, excluding appendices if required, must be minimum of 1,500 words and a maximum 1,600 words). This report should consider the case study in great detail, analysing the use, im..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Test the invoice application

Study the error message and note the line number in the statement in the InvoiceApp class that caused the crash. Then click on the link to that line of the code.

  Produce a java implementation of the gui

For your Assignment 2 Part 1 submission you are required to produce a Java implementation of the GUI for the Agriculture image viewer component of your overall Agriculture File Storing and Management (FSM) System.

  What are command line arguments in java

Modify the program such that if there are no command line arguments, when you type:

  That uses a library database of books

Write a Java program that uses a library database of books and patron data, as described in Exercise R22.2. Patrons should be able to check out and return books

  Java program that allows the user to enter a letter

Write a java program that allows the user to enter a letter (as a code) and a real number (as the radius of a circle). If the letter is 'A' your program must calculate the area of the circle. If the letter is 'C' your program must calculate the ci..

  Write a java program that will play connect four

Write a java program that will play connect four - Must be a simple program no applets, jframes.

  Create a java program to calculate the circumference

Create a Java program based on the geometric shapes. The program should begin by prompting you for the shape you want to calculate the circumference.

  Create a class that inherits from your pizzaorder class

Create a class that inherits from your PizzaOrder class called SeatedPizzaOrder. SeatedPizzaOrder has the three data values that any PizzaOrder has (size, toppings, and price) but also has a tablenumber (of type integer) and serverName (of type st..

  What things are you struggling to understand

Discuss your experiences with the programming assignment - what things are you struggling to understand?

  Write java application to show successive element of array

Write down java application named GoTooFar which declares the array of 5 integers and stored five values in array. write try block in which you loop to show each successive element of array.

  Calculates the product of the following sequence

Write a java code that calculates the product of the following sequence of numbers using for/loop and do/while/loop

  Compute the distance between the first two points

Compute the distance between the first two points and initialize the variable that represents the second shortest distance - Display the second shortest distance and the second closest two points.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd