Question: In Java pls. Thank you. public class BurritoBowl { private ArrayList fillings; private int numServings; public BurritoBowl(int servings) {} public void addFilling (String newFilling) {}
In Java pls. Thank you.
public class BurritoBowl {
private ArrayList
private int numServings;
public BurritoBowl(int servings) {}
public void addFilling (String newFilling) {}
public void serve() {}
}
a. Fill in the constructor for the BurritoBowl class, which intializes numServings to the argument specified in the constructor, and fillings to an empty ArrayList.
b. Fill in the addFIlling method, which takes a String argument newFilling (for example "blackbeans", "beef", etc.). This function should add this filling to the end of the list of fillings.
c. Then fill in the serve function. This function, when called, should print out "Serving burrito bowl" but only up to the number of times numServings field specifies. After that, when called, the function should print out "No more left". Example: If numServings is 5, then the BurritoBowl class should allow serve() to be called 5 times and then print out "No more left" on the 6th call. After first serve() call, there should be no more fillings added to the burrito bowl with addFilling().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
