Please find the attached graph.
Let x represent number of shirts and y represent number of caps.
We have been given that Mikhael, Hema, and 5 friends will help run their school's fundraiser. They will wear either a red shirt or a red baseball cap during the event.
Since there are 7 people in total, so total number of caps and shirts will be 7. We can represent this information in an equation as:
![x+y=7...(1)](https://img.qammunity.org/2021/formulas/mathematics/high-school/o28cngde5q4seblb5wktkinxumrksq7frk.png)
We are also told that Shirts cost $8 each and caps cost $4 each. So cost of x shirts would be
and cost of y caps would be
.
Since they want to spent exactly $40, so cost of x shirts and y caps will be equal to 40. We can represent this information in an equation as:
![8x+4y=40...(2)](https://img.qammunity.org/2021/formulas/mathematics/high-school/ia6rhty042670x5huuw9cxtrml597m36ug.png)
We can divide equation (2) by 4 as:
![2x+y=10...(2)](https://img.qammunity.org/2021/formulas/mathematics/high-school/5nj40hi76nscfit7ysv4aelztgbi82kgyn.png)
We can see from our attached graph that solution of this system is (3,4), therefore, 3 friends will wear shirts and 4 will wear caps to stay in the budget.