For example, lets say I want to make a code that asks the user, one by one, to enter the list of ingredients for homemade chocolate milk. Milk, sugar, cocoa powder.
System.out.println("Enter the 3 ingredients one at a time and press enter after each ingredient: "): String a1 = input.next(); String a2 = input.next(); String a3 = input.next(); String chocolateMilk = "milk, sugar, coaco powder"); //check to see if they match one by one. if statement?
I know I COULD just make the ingredients into 3 separate strings, but this is just a simple example for one that would contain much more ingredients(trying to find an easier way). Would I have to make the ingredients into 3 separate strings and just match it up in the end or is there another way? Lastly, how would I make it so that if the user gets all 3 or 2 or 1 of the ingredients correct, I can bring up a score for them?