Percentage of commission earned by the hat salesman = 30 percent.
Amount of money for which 3 hats were sold = 90 * 3
= 270 dollar
Amount of money for which 4 hats were sold = 50 * 4
= 200 dollars
Then
Total amount of money for which 7 hats were sold = 200 + 270
= 470 dollars
Amount of commission earned by the hat salesman = 470 * (30/100)
= 141 dollars
From the above deduction, the amount of commission earned by the hat salesman was $141.