Help me write this code?


#1

Hey, I was wondering if anyone could help me write this code. Thank you so much!

Jake needs to bake a cake in an hour. He needs Eggs, Milk, and Butter because everyone knows that's all you need to bake a cake. Jake makes a grocery list of all the things that he needs called groceryList and puts that list into a Java Array because he knows that's an efficient, yet simple way to store data.
Return true if Jake has all the ingredients to bake a cake. Otherwise return false.

JakeCake({"Butter","Eggs","Milk"}) → true
JakeCake({"Rope","Shovel","Gloves"}) → false
JakeCake({"Rope","Eggs","Milk","Shovel"}) → false


#2

I would solve this with a for-loop something like:

jakeCake = [item, item, item];
for (i = 0; i < jakeCake.length; i++) {
     switch
     case
     case....
    }
}