import java.util.ArrayList;
public class CoffeeShop
{
private ArrayList<String> MenuArray;
private double [] prices;
public CoffeeShop()
{
MenuArray=new ArrayList<String>(); //arraylist
MenuArray.add("0 Hot black coffee");
MenuArray.add("1 Iced mocha latte");
MenuArray.add("2 Iced lavendar matcha latte");
MenuArray.add("3 Hot biscoff latte");
MenuArray.add("4 Hot cappuccino");
MenuArray.add("5 Breakfast sandwhich");
MenuArray.add("6 Pumpkin muffin");
MenuArray.add("7 Butter crossiant");
double[] prices=new double[8]; //array
prices[0]=2.55;
prices[1]=5.50;
prices[2]=8.99;
prices[3]=6.15;
prices[4]=4.20;
prices[5]=4.25;
prices[6]=3.55;
prices[7]=2.50;
}
public double getMaxCost() //max for-loop
{
double mcost = 0;
for (int i=0; i<prices.length; i++)
{
if(prices[i]> mcost)
{
mcost = prices[i];
}
}
return mcost;
}
public String getMenu()
{
for (String menu1 : MenuArray)
{
System.out.println("We offer these items on our menu: " + menu1);
{
return ____;
}
}
}
}
//it keeps saying I need to return something because if I don't theres an error