A hyphenated adjective term that precedes a noun, like “5-day” in “a 5-day course,” is actually an abbreviated form of its equivalent but longer modifying phrase that comes after that noun. In the case of “a 5-day course,” that modifying phrase comes in the form “a course that lasts five days” or “a course that runs for five days.” The English grammar rule for abbreviating such a phrase when converting it into a modifier that precedes the noun is this: link the words describing the quantity or measure with a hyphen, but make the word for the quantity or measure singular. This is why “a course that lasts five days” or “a course that runs for five days” becomes “a five-day course” when transformed into a modifier that precedes a noun.
When the description of the quantity or measure that precedes a noun cannot be reduced into a single word, then we need to hyphenate all the words in the modifying term that will precede the noun to be modified. For instance, the modifier “that runs for five and a half days” becomes “five-and-a-half-day” when converted into a modifier that precedes the noun to be modified, so the phrase will read as follows: “a five-and-a-half-day seminar.” Keep in mind that the quantity or measure in plural (like “days”) must always be transformed into its singular form (“day” in the case of “days”) when forming the hyphenated modifier.
This rule of transforming the quantity or measure from its plural to singular form in hyphenated modifiers likewise applies to words that change in spelling when pluralized, like “men” to “man” and “women” to “woman.” Thus, when we transform the phrase “that consists of five men” in “a team that consists of five men” into a modifier preceding the noun “team,” it becomes the hyphenated modifying term “five-man” in “five-man team.” Similarly, “a contingent consisting of 50 women” becomes “a 50-woman contingent.”
(By the way, Paul, there's a common English stylebook rule that numbers less than 10—other rules say less than 11—should be spelled out when they are made to form part of a regular statement in writing. Thus, the preferred style for, say, “a 5-day course” would be “a five-day course” because “5” is less than “10,” and “a course that runs for 15 days” should be written in the abbreviated form “a 15-day course,” not “a fifteen-day course,” because “15” is more than “10” or “11.” Whether you choose “10” or “11” as the cutoff number, just be consistent in that choice all throughout and you’ll be OK.)