Can I get the code (in Java, please) for the Driver class, as shown below in the example, by using the code I provided below?
The Example Output for the Driver Class:
Here is the code (I tried my best for it to actually show up in the question).
Driver Class - BevShopDriverApp Create a class with a main method to demonstrate all classes (you created) that uses BevShop and Customer objects. Example of a Program output: 3 21 Start a new order Total on the Order: \( 0.0 \) John 23 true Add alcohol drink Total on the Order: \( 2.0 \) true Add second alcohol drink Total on the Order: \( 6.0 \) 2 Add third alcohol drink Total on the Order:8.0 3 Maximum alcohol drink for this order Add a COFFEE to order 3 Total on the Order:11.0 Total on the Order:11.0 Start a new order Total on the Order: \( 0.0 \) Add a SMooTHIE to order Total on the Order: \( 6.5 \) Add a COFFE to order Total on the Order:9.5 0 Age not appropriate for alcohol drink!! Total on the Order:9.5 Maximum number of fruits Total on the Order: \( 16.0 \) Total amount for all orders: \( 27.0 \)
evShop. java nport java.uti1. Arraylist; db7ic c7ass Bevshop implements BevShopInterface \{ // private int numofA1coholinorder; private int currentorderIndex; private ArrayList orders; \( / / \) public BevShopO \{ 3 orders = new ArrayList \( <(\mathrm{O} \); \( / / \) public string tostring() String \( s= \) "Monthly orders \( \backslash n^{\prime \prime} \); for (order 0 : orders) \{ \( 3 \quad 5+=0 . \operatorname{tostring}( \); \( 5+= \) "Total sale:" + totalmonth7ysa1eO; 3 return s; \( / / \) public boolean isvalidTime(int time) \{ if (time \( >= \) MIN_TIME \&\& time \( <= \) MAX_TIME) \{ 3. return true; 3 \( / / \) public boolean isvalidage(int age) \{ if (age \( >= \) MIN_AGE_FOR_ALCOHOL) \{ return true; return false; \} // pub1ic boolean iseligibleformore \( \mathrm{e}\{ \) if (numofa1coholinorder \( <3 \) ) \{ return true; feturn false; \} / \( / \) public boolean ismaxfruit(int numoffruits) \{ if (numoffruits \( > \) MAX_FRUIT) \{ return true; feturn false; \} \( / / \) public void startNeworder(int time, Day day, string customername, int customerAge) \{ Customer customer = new customer (customername, customerAge); order order = new order (time, day, customer); orders. add(order); currentorder Index \( = \) orders. indexof(order); numofA 1 coho 1 Inorder \( =0 \); 3 \( / / \) public void processcoffeeorder(String bevName, size size, boolean extrashot, boolean strasyrup) \{
* eparam extrasyrup true if the coffee beverage has extra syrup, false otherwise public void addNewBeverage ( string bevname, size size, boolean extrashot, boolean extrasyrup); \( / \) tra * adds alcohol order to this order * aparam bevName beverage name * eparam size beverage size \( t / \) public void addNewBeverage ( String bevName, size size); \( / m \) * Adds the Smoothie beverage to this order - aparam bevName beverage name * eparam size beverage size * aparam numoffruits number of fruits added * eparam addprotein true if protein is added, false otherwise "/ public void addNewBeverage ( String bevName, size size, int numoffruits, boolean addProtein); \( / x \) - Calculates and returns the total amount for this order * ereturn total amount for this order \( \Rightarrow \) / public double calcorderTota10; \( \Rightarrow= \) * returns the number of beverages of same type in an order * aparam type the type of the beverage * ereturn number of beverages of type type in this order \( * / \) public int findNumofBeveType(Type type); \} Day. java public enum Day \{ MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY; 3 Type.java pub7ic enum Type COFFEE, SMOOTHIE, ALCOHOL; size.java pub7ic enum Size SMALL, MEDIUM LARGE;