Question

1. Create a new multi-class Java program which implements a vending machine simulator which contains the...

1. 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). 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. D) Code to input data from the console will be supplied.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1. Create a new multi-class Java program which implements a vending machine simulator which contains the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Pyhton Program : Write a coffee vending machine class. Include fields giving the number of cups...

    Pyhton Program : Write a coffee vending machine class. Include fields giving the number of cups of coffee available, the cost of one cup of coffee, and the total amount of money inserted by the user. This machine requires exact change. Include one constructor which stocks the machine with a quantity and price of coffee specified as parameters. Include the following methods; menu() // display the quantity and price of coffee insert(int quarters, int dimes, int nickels) // insert the...

  • Vending Machine (Python 3) Thinking Outside the box Write a program that asks the user to...

    Vending Machine (Python 3) Thinking Outside the box Write a program that asks the user to enter a bill value (1 = $1 bill, 5 = $5 bill, etc.) and the price of an item they want to buy in pennies and calculate their change amount in dollars, quarters, dimes, nickels, and pennies. Your code should start like this: ## # This program simulates a vending machine that gives change # Define constants PENNIES PER DOLLAR = 100 PENNIES PER...

  • Write a C+OOP program that simulates a vending machine. The program should define at least two...

    Write a C+OOP program that simulates a vending machine. The program should define at least two classes. Less than two classes will result in 20 points deduction. (30 points) One must be general vending machine (50 points) The other can be either vending machine of soda, or vending machine of snack. It must be a subclass of above general machine These vending machines should have following components and functions e Coin slot o Allow adding coins o Display total coin...

  • Overview - Vending Machine For this project, we will simulate a vending machine where, for simplicity,...

    Overview - Vending Machine For this project, we will simulate a vending machine where, for simplicity, all of the items in the machine are the same price of $1.25 The vending machine can receive Nickels, Dimes, Quarters, and one dollar Bills. The user can add money, ask for the product, ask for their money back, or walk away (exit). The program will interact with the user and allow the following commands: N - adds nickel D - adds dime Q...

  • C++ HW Question Your program will simulate a simple change maker for a vending machine. It...

    C++ HW Question Your program will simulate a simple change maker for a vending machine. It will start with a stock of coins and dollars. It will then repeatedly request the price for an item to be purchased or to quit. If given a price, it will accept nickels, dimes, quarters, one-dollar and five-dollar bills—deposited one at a time—in payment. When the user has deposited enough to cover the cost of the item, the program will calculate the coins to...

  • Assignment: Write a program in C++ that allows a customer to go on-line shopping. This is...

    Assignment: Write a program in C++ that allows a customer to go on-line shopping. This is a start-up venture and the stock of our on-line company is currently limited to the following items: A gift card to Home Depot, $50.00 A bottle of cologne (The One by Dolce Gabbana), $24.00 3. Akeychainwithabathtubornament,$14.00 4. Acard,$4.00 Although all items are in stock, the customer should only be made aware of the items that he or she can afford. In addition, demand for...

  • Objectives: Use the while loop in a program Use the do-while loop in a second program...

    Objectives: Use the while loop in a program Use the do-while loop in a second program Use the for loop in a third program Instructions: Part A. Code a for loop to print the Celsius temperatures for Fahrenheit temperatures 25 to 125. C = 5/9(F – 32).Output should be in a table format: Fahrenheit Celsius 25 ? . . . . . . . . Turn in the source and the output from Part A. Part B. Code a while...

  • Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10...

    Your program must meet the following specifications: 1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. 2. Repeatedly prompt the user for a price in the form xX.xx, where X denotes a digit, or to enter q' to quit 3. When a price is entered a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a 'q)...

  • 1- TigerOne Bank is a local bank that intends to install a new automated teller machine...

    1- TigerOne Bank is a local bank that intends to install a new automated teller machine (ATM) to allow its customers to perform basic financial transactions. Using the ATM machine users should be able to view their account balance, withdraw cash and deposit funds. The bank wants you to develop the software application that will be installed on the new ATM machines. The following are the requirements for the application:  Users are uniquely identified by an account number and...

  • Must be done in C# please! Thanks! In this assignment you will create a program named...

    Must be done in C# please! Thanks! In this assignment you will create a program named Test Scores that displays the average of all tests; average midterm score; average final score; and displays the midterm or final score of a particular student. Create a class level two dimensional integer array named Grades initialized with the following data: 897 242 301 987 116 450 865 128 992 109 88 75 94 70 90 87 81 79 97 79 78 80 92...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT