Complete C++ source code for 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.
Complete C++ source code for 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.
![Part A: Problem Details
IKEO 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).
Туре А
Туре В
Table: 1 type A
Chair: 1 type A
2 type B
1 type B
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 andN= 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?](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8fbbe91e-b101-441b-b5fc-9477065585b8%2F6bd19744-b68c-4bc1-87e3-2b19bbac89b9%2Fl1247fl_processed.jpeg&w=3840&q=75)
![Part B: Assignment Requirements
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
6.
30
1
28
31
3
4
29
4
4
32
30
33
7
2
31
8
34
32
10
1
35
11
33
12
36
Greatest profit is RM36 where 12 tables and 0 chairs are produced.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8fbbe91e-b101-441b-b5fc-9477065585b8%2F6bd19744-b68c-4bc1-87e3-2b19bbac89b9%2F92yperj_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Operations Research : Applications and Algorithms](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![A+ Guide To It Technical Support](https://www.bartleby.com/isbn_cover_images/9780357108291/9780357108291_smallCoverImage.jpg)
![Operations Research : Applications and Algorithms](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![A+ Guide To It Technical Support](https://www.bartleby.com/isbn_cover_images/9780357108291/9780357108291_smallCoverImage.jpg)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)