Question

John wants to buy something for himself with his pocket money. He has a budget of...

John wants to buy something for himself with his pocket money. He has a budget of $105 to spend on $25 T-shirts, $10 CDs, and $5 books. He wants to buy 10 items and wants to buy as many books as T-shirts and CDs combined. Using MATLAB, how many of each item should he buy? Write a system of equations to help you solve this problem.

Please include everything that must be typed in to accomplish this

Homework Answers

Answer #1

Given that,

system of equations:

let,

x = number of T-Shirts bought,

y = number of CDs bought,

z = number of books bought

Given that,

total money spent = $105, so , the first equation is :

25x + 10y + 5z = 105

Then, total number of items bought is 10, the second equation is:

x + y + z = 10

Then. number of books(z) = number of CDs and T-Shirts combined(x+y). The equation is:

x + y - z = 0

Now, we have the system of linear equation, we will solve it using the backslash \ operator

program:

%System of equations:

%25x + 10y + 5z = 105 : A total of $105 spent

%x + y + z = 10 : A total of 10 items bought

%x + y - z = 0 : number of t-shirts + CDs = number of books

A = [25 10 5; 1 1 1; 1 1 -1];

b = [105; 10; 0];

X = A\b;

fprintf('Number of T-shirts: %d\n', X(1))

fprintf('Number of CDs: %d\n',X(2))

fprintf('Number of books: %d\n',X(3))

output:

Number of T-shirts: 2.000000e+00

Number of CDs: 3.000000e+00

Number of books: 5

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Case Study: Not Easy Being Indie Tough time to be in the retail music business. That...
Case Study: Not Easy Being Indie Tough time to be in the retail music business. That wasn’t always the case as chains such as Sam Goody’s and Tower Records competed side by side with thousands of independent record stores. Back in the day, one of the best independents was Millennium Music in Charleston, South Carolina—perennially winning awards for best CD store and best store staff. But things change. Millennium Music owner Kent Wagner had done everything possible to fight the...
Chick-fil-A is dominating the U.S. fast-food market. Whereas McDonald’s, Subway, Burger King, and Taco Bell trudge...
Chick-fil-A is dominating the U.S. fast-food market. Whereas McDonald’s, Subway, Burger King, and Taco Bell trudge along at the top of the heap, Chick-fil-A has quietly risen from a South- east regional favorite to become the largest chicken chain and the eighth-largest quick-service food purveyor in the country. The chain sells significantly more food per restaurant than any of its competitors—twice that of Taco Bell or Wendy’s and more than three times what the KFC Colonel fries up. And it...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT