You are to design a Java application to control the operations of at least 2 sna
ID: 3584642 • Letter: Y
Question
You are to design a Java application to control the operations of at least 2 snacks and drinks vending machines. Each vending machine has at least 10 dispensers and each dispenser holds at least 20 of one kind of drinks or snacks for purchase. Each dispenser should also display the price, name, and nutrition information for the snack or drink it holds. You may display whatever nutrition information you prefer. Just make it interesting and appealing to clients. Each vending machine must also display a menu of drinks and snacks available on each dispenser for clients to choose from. A client must first enter enough money to make a purchase. If the client's choice has run out or the entered money is not enough, the purchase won't continue. Design an exception and its handler to handle the situation such as error message, money return, or asking for another choice or more money amount. Print a receipt after each purchase including name and price of the purchased item, entered money amount and change. Use a random number generator to determine client arrival and which vending machine the client is using. Also use a random number generator to decide when the machines will be turned off and program execution terminates. If you desire, you may use a real time clock or a loop to determine when to turn off the vending machines. Before the program execution terminates, save the inventory of the vending machines in a file for next program execution. Also save the sales total and the subtotal and number of items sold on each dispenser in a separated file.Explanation / Answer
DOCTYPE html>
First Name:
Last Name:
Email Address:
Credit Card Number:
Expiration Date:
CVC:
There are three things to note about the code snippet above.
First, we’ve set the form’s action to “javascript:” rather than providing a path to a server-side script. (You’ll see why in just a minute.)
Secondly, there’s a short snippet of PHP that automatically populates our expiration-year field with the next 20 years so that we don’t have to update that manually in the future.
Thirdly, none of the form fields have a “name” parameter set. This is crucial because it will prevent the value of the field (such as the credit card number) from being sent to our server when the form is submitted. We’ll talk about why this is important in just a minute.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.