The first step is to section the given daigram. It would be shown in the diagram below
Looking at the diagram,
Area of family room = 5.5 * 24 = 132 square feet
Area of hallway = 15.5 * 4 = 62 square feet
Total area to be covered with carpet is
132 + 62 = 194 square feet
Since the cost per square foot is $4, then the cost of putting carpet in the family room and hallway is
194 * 4 = $776* 4 = $776