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) 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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)

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education