3. A tailor makes wool tweed sport coats and wool slacks. He isable to get a shi
ID: 2916715 • Letter: 3
Question
3. A tailor makes wool tweed sport coats and wool slacks. He isable to get a shipment of 150 square yards of wool cloth fromScotland each month to make coats and slacks, and he has 200 hoursof his own labor to make them each month. A coat requires 3 squareyards of wool and 10 hours to make, and a pair of slacks requires 5square yards of wool and 4 hours to make. The tailor earns $50 inprofit form each coat he makes and $40 from each pair of slacks. Hewants to know how many coats and pairs of slacks to produce tomaximize profit.
a. Formulate an integer linearprogramming model for this problem.
b. Determine the integer solution tothis problem by using the computer. Computer this solution with thesolution without integer restrictions and indicate whether therounded down solution would have been optimal.
Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
int x1 = 0;
int x2 = 0;
int profit = 0;
for(int i = 1; i <= 150; i++)
for(int j = 1; j <= 150; j++)
{
if(i%3 != 0 || j%5 != 0)
continue;
if((i*10 + j*4) > 200)
continue;
if( (i*50 + j*40) > profit)
{
profit = i*50 + j*40;
x1 = i;
x2 = j;
}
}
cout <<"Coats: " << x1 << endl << "Slacks: " << x2<< endl;
cout << "Profit: " << profit<< endl << endl;
system("pause");
return 0;
}
//Coats: 3, Slacks: 40, Profit:1750
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.