Answered You can hire a professional tutor to get the answer.

QUESTION

Print either "Fruit" or "Drink" (followed by a newline) depending on the value of userItem. For example, if userItem is GR_APPLES, output should...

(followed a newline) depending the value userItem. For example, userItem GR_APPLES, output should be:Fruit

import java.util.Scanner;

public class GrocerySorter {

  public enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER};

   public static void main (String [] args) {

   GroceryItem userItem = GroceryItem.GR_APPLES;

   if((userItem == GroceryItem.GR_APPLES) || (userItem == GroceryItem.GR_BANANAS)

   return;

  }

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question