Question: fix the java code: / / simulates a simple vending machine with operations to purchase drinks and check inventory. public class VendingMachine { / /
fix the java code: simulates a simple vending machine with operations to purchase drinks and check inventory.
public class VendingMachine
number of bottle in stock
private int bottles;
initial inventory is
public VendingMachine
bottles ;
public void purchaseint amount
bottles bottles amount;
public int getInventory
return bottles;
public void restockint amount
bottles bottles amount;
public void report
System.out.printlnInventory: bottles bottles";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
