Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use array, thank you Part A: Problem Details IKEO is a furniture manufacturer which produces two sizes of wood blocks (type A and B)

image text in transcribed
image text in transcribedplease use array, thank you
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). T Type A Type B Table: 1 type A 1 type B Chair: I type A 2 type B Figure 1 A table makes RM 3 profit, and a chair makes RM 5 pro 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 1 2 3 4 5 6 7 8 9 10 11 12 6 5 5 4 4 3 3 2 2 1 1 0 0 30 28 31 29 32 30 33 31 34 32 35 33 36 Greatest profit is RM36 where 12 tables and chairs are produced

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions