Project 1
#include
#include
const int NUM_PEOPLE = 3;
const int NUM_COMMODITIES = 5;
const int NUM_VENDORS = 2;
int main() {
const char* commodities[] = {"Laptop", "Mouse", "Headset", "Laptop Bag", "Adapter"};
double vendorPrices[NUM_VENDORS][NUM_COMMODITIES] = {
{45000, 1500, 2500, 1200, 1600},
{43000, 1200, 3000, 1000, 1500}
};
int quantities[NUM_PEOPLE][NUM_COMMODITIES] = {
{5, 15, 10, 5, 20},
{10, 10, 25, 10, 15},
{3, 5, 6, 3, 10}
};
double totalCosts[NUM_PEOPLE][NUM_VENDORS] = {0};
for (int i = 0; i < NUM> for (int j = 0; j < NUM> for (int k = 0; k < NUM> totalCosts[i][k] += vendorPrices[k][j] * quantities[i][j];
}
}
}
// Determine the best vendor for each person
int bestVendors[NUM_PEOPLE];
for (int i = 0; i < NUM> bestVendors[i] = totalCosts[i][0] < totalCosts> }
// Display results
std::cout << "Best Vendors for Each Person:" << std> for (int i = 0; i < NUM> std::cout << "Person " << i xss=removed> }
return 0;
}