Java Coding BaristaMatic Simulator Automatic Coffee Dispensing Machine

Anonymous
timer Asked: Feb 21st, 2019
account_balance_wallet $10

Question Description

Hello, please solve this probelm using java, eclipes. this should be an easy work. please use alot of comment to explain your work and also do it by very basic way. Thank you for your time

Problem Description: Your task is to create a simulator of an automatic coffee dispensing machine, called the BaristaMatic. The machine maintains an inventory of drink ingredients, and is able to dispense a fixed set of possible drinks by combining these ingredients in different amounts. The cost of a drink is computed as the total cost of its component ingredients. Upon startup, the BaristaMatic should display its current inventory, followed by a menu to allow the user to select a drink. As drinks are dispensed, the inventory of ingredients should be maintained, to continually and accurately reflect current stock in the machine. Only drinks for which there is sufficient inventory can be dispensed. The specified input and output formats for the BaristaMatic must be followed exactly. At the end of these instructions, you will find examples of some input/output scenarios. Your BaristaMatic machine should be capable of dispensing the following drinks: The BaristaMatic machine is capable of holding 10 units of each ingredient. At startup, the BaristaMatic should be fully stocked with all ingredients. Restocking the machine should restore the inventory of each ingredient to its fully-stocked state. Input Format: Your solution should read from the standard input stream, one command per line. No prompts or other extraneous user messages should be displayed. Blank input lines should be ignored. Each valid command consists of a single character, as follows: If the user enters an invalid command, then the program should display a single-line message with the following format: Invalid selection: If the user selects a valid drink number, and the machine has sufficient ingredients on hand to make the drink, then the program should display a single-line message with the following format: Dispensing: On the other hand, if the drink order cannot be completed, then the program should display a single-line message with the following format: Out of stock: The inventory and menu (see next section) should be displayed immediately, one after the other, following any applicable message. Output Format: All output should be written to the standard output stream. At program startup, and following the processing of every command, the machine inventory and the drink menu should be displayed. Both the inventory list and the drink menu should be displayed in alphabetic order (by ingredient name or drink name, respectively), in the following format: Inventory: , ... , Menu: ,,, ... ,,, Drinks should be numbered sequentially, starting at 1, in the order they are displayed in the menu. Cost should be displayed in standard currency format (US dollars). The in-stock indicator should be either "true" or "false". Note: the sample output is indented in these instructions to make it easier to read. The output generated by your program should not have any whitespace at the beginning of a line. Technical Notes: It is not required that the initial machine configuration (inventory counts, available drinks and prices, etc.) be dynamic. In particular, it is acceptable to perform this initialization in code, rather than reading the configuration from an external file or database. However, your program should be flexible enough to allow new drinks to be added to the menu without requiring extensive code changes. The following qualities will be considered when evaluating your solution: • Functionality (solution satisfies these requirements) • Soundness and appropriateness of overall design • Clarity, readability and maintainability of source code • Quality of unit tests, if provided • Packaging (ease with which we can open, install, and execute the solution)

Tutor Answer

Tellos
School: Carnegie Mellon University

This one too ha...

flag Report DMCA
Review

Anonymous
awesome work thanks

Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors