Reference no: EM131551824
Assignment: DrinkMachine Applet
Basic Steps in Creating your Program
1. Plan your logic before working on the project and review the syntax you will use in the project. Think about how you want the output to be displayed to the user. You might want to tell the user what the program does and what type of input you expect from the user. You interface structure could do this. Select names of the variables you will use in the program.
2. Create a JAVA project Using NetBeans IDE. And have the code window open to write the project code. Here are some instructions on creating the project.
• Declare variables to hold input information.
• Using the JOptionPane Concept. (Some programs might need just the Scanner.
• Ask the user to enter some information requested and save the response to a variable. This could look like: name = JOptionPane.showInputDialog ("Enter your name").
• Use line spacing (i.e.\n) to separate lines of output to make it easy for the user to read the information and have proper line length.
3. Documentation: All lines of code must be documented.
• Use the syntax to designate lines in code as comments (//)
• These comments can be at the end of a line of code or in a group definition at the beginning of a section of code. All methods and function need a group heading document.
4. Run the program using Run Project menu item.Debug the code, making sure all calculations are correct and the line spacing is suitable for readability.
Your program Assignment
Write an applet that simulates a soft drink vending machine. The simulated machine dispenses the following soft drink:
• Cola
• Lemon-lime
• Grape
• soda,
• root beer
• 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 whether 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.
Identify methods of recording the crime scene
: Identify the tools needed to collect and process evidence at a crime scene. Identify methods of recording the crime scene.
|
What type of naming structure would you give to servers
: What type of naming structure would you give to servers, network devices and end nodes in this network? Provide a few examples.
|
Conduct research on the code of hammurabi
: Conduct research on the "Code of Hammurabi" and explain its influence on contemporary society.
|
Find the mean area of the inside bottom of the box
: Let X be the inside length, Y be the inside width, and Z be the inside height of a box. Suppose µX = 20, µY = 15, and µZ = 12, while sX = .5, sY = .25.
|
Create a java project using netbeans ide
: Create a JAVA project Using NetBeans IDE. And have the code window open to write the project code. Here are some instructions on creating the project.
|
Who are the stakeholders of homeland security
: Who are the stakeholders of homeland security? Who are the primary stakeholders and who have more of a peripheral role?
|
Obtain a collection of n small images in png or jpg format
: Obtain a collection of n small images in PNG or JPG format, where n is an integer between 3 and 10. Index the images with numbers 1,. . . n.
|
The services of the national guard units
: The services of the National Guard units may respond when needed to save lives, prevent human suffering or mitigate great property damage.
|
Find a two-sided interval
: Refer to the Oil Field Production case in Consider the 52 wells completed using the first method, and assume that oil production from wells.
|