Nouns (such as star in the above sentence) can function as an adjective in a sentence.We can use a number with a noun to make a compound adjective. Since the number and noun make one unit, we use a hyphen to join them. Keep in mind that the noun remains singular because it is being used as an adjective.
a three-car garage
a ten-speed bicycle
a twenty-dollar bill
two grammar books (2 grammar books)
five coffee cups (5 coffee cups)
We can use a number to refer to the second noun (how many) and a number with the first noun (compound adjective). In that case, there is no hyphen after the first number, but the second number is still used with a hyphen because it forms a compound adjective.
two ten-dollar bills (2 ten-dollar bills)
four three-bedroom homes (4 three-bedroom homes)