"He eats a cheese sandwich."
Translation:Er isst ein Käsesandwich.
The second noun dictates the gender, i.e. in this case "Sandwich". "Sandwich" can be either masculine or neuter, so the whole word is either "das Fischsandwich" (which I would prefer) or "der Fischsandwich". The reason behind the two genders is probably that "Sandwich" is a loan word from English. It takes some time before there is a consensus on gender.