Hello! I am basically having trouble on a homework prompt and need a little help with scenarios that break my code. Basically the prompt is that there is a sled that can carry three items, fish, fur, and crafts, and the user is able to input the weight of the fish, fur, and crafts, and the carrying capacity of the sled. The goal of the program is to tell the user which combination or which of the three items they are able to carry to get as close as possible to the max value without going over. I am having a problem on the scenario where there are multiple doubles that work: for instance if the inputted value for each is 5, 5, and 5, and the max weight that the sled can carry is 10, the user can carry any combination of two of the goods. Here is my code so far, Thanks! :
// Example program
#include <iostream>
#include <string>
using namespace std;
int main()
{
int userFur = 0;
int userFish = 0;
int userCrafts = 0;
int userMax = 0;
int goodsTotal = 0;
int furFish = 0;
int furCrafts = 0;
int fishCrafts = 0;