Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm taking a java class, and I need the code for this ASAP. Thanks You are writing code for a souvenir vending machine that produces
I'm taking a java class, and I need the code for this ASAP. Thanks
You are writing code for a souvenir vending machine that produces a wax figure of Mickey Mouse is a selection of colors with the purchaser's first name on the base. You must allow the user to enter their first name and choose what color they want from a numbered menu. Their name and color choice are added to an ArrayList of Strings so that the first element is a name, the second a color, the third a name etc. Once their order is placed the screen needs to return to the name prompt for the next customer. A manager can enter"orders123" for the name and screen will display all the orders. A manager can also enter "quit123" for the name in order to shut down the program. If "orders123" is entered, the screen will display the contents of the entire ArrayList as follows Name: Fred Color: red Name: Pebbles Color: purple The program will need main, getName, getChoice, addOrder, and displayOrders methods. The only global variable will be a Scanner object. An ArrayList of Strings will be created in main and passed to methods as needed. main continues looping until the manager chooses to exit. getName has no parameters and returns a String name. It checks to make sure the name is not blank before returning .getChoice has no parameters and returns a String color choice. The method continues prompting until the input matches one of the numbers in the menu addOrder is a void method that has parameters for the name, the color, and the ArrayList of orders. It simply adds the name and color to the ArrayList. displayOrders is a void method that has a parameter for the ArrayList of orders. It loops through the entire ArrayList and outputs the orders as shown above Create the entire project in NetBeans. Pay special attention to the names of the methods, the parameters, and the return datatypes required. Do not deviate from these. Do not rely on global variables, except for the Scanner object. Make sure the whole thing works as described in the first paragraph. (Note: Method comments are not required for the exam.) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started