HOMEPRO is a furniture manufacturer which produces two sizes of wood blocks (type A and B) that are used to make either a table or a chair. A table is made of a type A and a type B wood blocks,while a chair is made of a type A and two type B wood blocks (See Figure 1) A table makes RM 3 profit, and a chair makes RM 5 profit. If M number of type A and N number of type B wood blocks are produced, how many tables and chairs should the manufacturer make to obtain the greatest profit? For example, let M = 12 and N = 12. By making 4 tables (4 type A and 4 type B) and 4 chairs (4 type A and 8 type B), the manufacturer gain profit as follows, Profit = (RM 3) × 4 + (RM 5) × 4 = RM 32. If the manufacturer makes 2 more tables and 1 less chair, the profit will be increased as follows, Profit = (RM 3) × 6 + (RM 5) × 3 = RM 33. Is this the greatest profit? Write a complete C++ program to help the manufacturer determine the greatest profit obtain from making tables and chairs with a given number of M type A and N type B wood blocks. • The program should prompt the user to input M and N. • Then tabulates all the combinations of tables and chairs possibly made, and calculates the profit obtain using array. • The program should also identify the greatest profit and make a concluding remark. • The program should be written in modular form with the main() function calling other functions. If arrays are involved in the function, the arrays should be passed into the function as parameters. • Lastly, display the output to an external .txt file. Sample outputs are given as follows: Program to Calculate Profit of Furniture: Tables and Chairs ---------------------------------------- The number of Type A wood block is 12 The number of Type B wood block is 12 ------------------------------- Tables Chair Profit ------------------------------- 0 6 30 1 5 28 2 5 31 3 4 29 4 4 32 5 3 30 6 3 33 7 2 31 8 2 34 9 1 32 10 1 35 11 0 33 12 0 36 ------------------------------- Greatest profit is RM36 where 12 tables and 0 chairs are produced   For testing and verification, produce output for the following set of M and N. M = 12, N = 12 M = 12, N = 20 M = 12, N = 25

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter9: Integer Programming
Section9.6: Solving Combinatorial Optimization Problems By The Branch-and-bound Method
Problem 2P
icon
Related questions
Question

HOMEPRO is a furniture manufacturer which produces two sizes of wood blocks (type A and B) that
are used to make either a table or a chair. A table is made of a type A and a type B wood blocks,while a chair is made of a type A and two type B wood blocks (See Figure 1)

A table makes RM 3 profit, and a chair makes RM 5 profit. If M number of type A and N
number of type B wood blocks are produced, how many tables and chairs should the
manufacturer make to obtain the greatest profit?
For example, let M = 12 and N = 12.
By making 4 tables (4 type A and 4 type B) and 4 chairs (4 type A and 8 type B), the
manufacturer gain profit as follows,
Profit = (RM 3) × 4 + (RM 5) × 4 = RM 32.
If the manufacturer makes 2 more tables and 1 less chair, the profit will be increased as follows,
Profit = (RM 3) × 6 + (RM 5) × 3 = RM 33.
Is this the greatest profit?

Write a complete C++ program to help the manufacturer determine the greatest profit obtain
from making tables and chairs with a given number of M type A and N type B wood blocks.
• The program should prompt the user to input M and N.
• Then tabulates all the combinations of tables and chairs possibly made, and calculates
the profit obtain using array.
• The program should also identify the greatest profit and make a concluding remark.
• The program should be written in modular form with the main() function calling other
functions. If arrays are involved in the function, the arrays should be passed into the
function as parameters.
• Lastly, display the output to an external .txt file.
Sample outputs are given as follows:
Program to Calculate Profit of Furniture:
Tables and Chairs
----------------------------------------
The number of Type A wood block is 12
The number of Type B wood block is 12
-------------------------------
Tables Chair Profit
-------------------------------
0 6 30
1 5 28
2 5 31
3 4 29
4 4 32
5 3 30
6 3 33
7 2 31
8 2 34
9 1 32
10 1 35
11 0 33
12 0 36
-------------------------------
Greatest profit is RM36 where 12 tables and 0 chairs are produced

 

For testing and verification, produce output for the following set of M and N.

  1. M = 12, N = 12

  2. M = 12, N = 20

  3. M = 12, N = 25

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Bayes' Theorem
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole