import java.util.LinkedList; import java.util.Scanner; import java.util.HashMap; public class Food{ public static void main(String[] args){ String[] nutrients = {"Carbs", "Protein", "Fat", "Vitamin A(%)", "Vitamin C(%)", "Vitamin E(%)", "Vitamin K(%)", "Iron(%)", "Magnesium(%)", "Zinc(%)", "Calcium(%)", "Potassium(%)", "Calories"}; Double[] foodssum = new Double[13]; setFoodSumZero(foodssum); HashMap map = new HashMap(); createAndSetupData(map); System.out.println("Welcome to Paul's Food Nutrient Track"); System.out.print("Foods avaiable: "); getFoods(map); System.out.print("Type the exact food name to add the food. Type \"done\" to conclude \nFood:"); Scanner in = new Scanner(System.in); String n; while(!((n = in.next()).equals("done"))){ try{ if(!map.containsKey(n)) throw new MyException("Food isn't supported"); Double[] selected = map.get(n); System.out.println("Amount in grams?"); int g; do{ g = in.nextInt(); if(g<=0) System.out.println("Please don't enter negative numbers or zero. Try again"); else setupGrams(selected, g); } while(g<=0); for(int i = 0; i list){ Object[] names = list.keySet().toArray(); for(int i=0; i