import java.util.Scanner; public class CarColorCountProgram { public static final int MAX_COLORS = 25; public static void main(String[] args) { String[] colors = new String[MAX_COLORS]; int[] counts = new int[MAX_COLORS]; int uniqueColors = 0; String enteredColor = "???"; System.out.print("Enter car color: "); enteredColor = new Scanner(System.in).nextLine(); // Keep going until no more colors are entered while (!enteredColor.equals("")) { // Determine if the color is already there int colorIndex = -1; for (int i=0; i counts[bestCountIndex]) bestCountIndex = i; } System.out.println("The most popular color is: " + colors[bestCountIndex]); } }