Implement a vending machine simulator

Assignment Help JAVA Programming
Reference no: EM131587592

Create a new multi-class Java program which implements a vending machine simulator which contains the following functionality:

A) At program startup, the vending machine is loaded with a variety of products in a variety of packaging for example soda/tonic/Coke in bottles, peanuts in bags, juice in cartons, etc. Also included is the cost of each item. The program should be designed to easily load a different set of products easily (for example, from a file).

Also at program startup, money should be loaded into the vending machine. Money should consist of different monetary objects for the specified currency for example $1 bills, $5 bills, quarters, dimes, etc. Your program should be designed to use different national currencies easily (for example the Euro) without changing source code. Money should be maintained as paper bills and coins, not just amounts.

B) A menu of commands must be provided. At a minimum the menu should consists of the following commands:

1. Display the list of commands
2. Display the vending machine inventory. For each item, this command should result in displaying a description and current quantity.
3. Display the money currently held in the vending machine.
4. Purchase an item. The result of this selection should be the following actions:
1. Prompt the user to indicate what item to purchase
2. Prompt the user to specify what monetary items are being used for payment (the actual items for example quarters, dimes, etc.), not a money amount
3. If the user specified enough money to purchase the selected item, the item is purchased (deducted from inventory), supplied money is added to the vending machine, and any change is returned in the form of monetary items (quarters, dimes, etc.).
4. If the user did not specify enough money for the selected item, the transaction is aborted with the supplied money not added to the machine (not accepted) and the product not purchased (i.e. the state of the vending machine is unchanged).
5. Exit - exits the program displaying a departing message.
2. Additional points to consider:
A) You can use the Java Standard Edition (SE) API library as supplied by Oracle (AKA Sun) except the collection classes other than String and standard arrays (i.e. not ArrayList, Map, Vector, etc.). These other collections will be covered later in the course.

B) When developing complex classes, consider creating a main() method to test them out. Once tested successfully, delete the main() method.

C) You should generate error messages when appropriate, for example on invalid input values or not enough money supplied for the selected item to purchase. Exceptions will be covered later in the course so for this program displaying appropriate messages on the console is fine.

Reference no: EM131587592

Questions Cloud

What alternative approaches were considered : What alternative approaches were considered and why were they rejected and What did you learn from doing this project and what would you do differently
Explain the degree of decentralisation of your organisation : Explain the type of organisational structure your organisation uses; Explain the degree of decentralisation of your organisation
Explain the benefits of using a case study for dba : Explain the benefits of using a case study for DBA doctoral research, including an example from scholarly research that supports your assertion.
Determine the risk level of the stock from your investors : Based on your financial review, determine the risk level of the stock from your investor's point of view
Implement a vending machine simulator : Create a new multi-class Java program which implements a vending machine simulator which contains the functionality
Present the advertising marketing and sponsorship efforts : Choose a company/brand that is only based in Asia. Present the Advertising, Marketing and sponsorship efforts the chosen Asia based company has done before.
How to solve rate-of-wind and rate-of-current problems : Explain the geometric sense of a linear system in two variables. Describe the possible cases.
Discuss the electronic health records and benefits : Physicians have been moving from paper medical records to Electronic Health Records (EHR). Discuss the Electronic Health Records, benefits, and challenge
How organization need to perform an audit trail : How often does an organization need to perform an audit trail to make sure all transactions are recording with due diligence

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a class named studentgrades

Write a class named StudentGrades. The constructor of StudentGrades should accept an array of student grades as its argument.

  Program to get final grade that should not be alphabet

Write a program to get final grade that should not be alphabet (i.e. out of 1-100). Each student has to give 5 lab assignments which is maximum score of 20, 4 quiz competitions which is maximum score of 20,

  Define method headers for computeaveragesales

Define method headers for computeAverageSales() and computeShipping Charges() according to the following requirements. Develop pseudocode for two new methods to be added to your product class

  Java gui program to calculate monthly payment

Java GUI program to calculate monthly payment. The GUI has JTextFields and JButton

  Project detailsyou will explore basic socket programming

project detailsyou will explore basic socket programming threading and gui design using javas network library threading

  The string class and/or the stringbuffer class in java

Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Calculate the age of a person given the birthdate

Assemble a program to calculate the age of a person given the birthdate. The output should print the line "In 2014 you will be ''the age of the person" years old." Code needs to be in assembly language using motorola 68000.

  What does this sequence of statements print

What is wrong with the following variable declarations - What does this sequence of statements print

  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.

  Class sorter which contains methods for selection sort

Write a class Sorter which contains methods for selection sort, insertion sort and bubble sort (start with the code below). Then create a client class which asks user to enter ten numbers using arrays. Then the program asks user which sorting algo..

  Write an application class that contains several methods

Write a driver class. This class should use the main method to call four methods in the application class that will display our JOptionPanes - Write an application class that contains several methods.

  Write a java tcp socket program to do tcpsocket server

Write a Java TCP socket program to do TCPSocket server. When starts the server, IP address of the machine must be displayed so the client can use to connect.

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