Question: programming Programming Language: python Can you explain the functions and loops for this code? I have attached a photo of what this code solves. code
code
questionFor this task, you need to write code which works out, given an inventory of products, what is the consignment to be loaded onto a lorry with weight limit n, which has the greatest possible value. A lorry can carry at most n kilograms. The name of the materials, the amount of material in kilograms and the material price per kilo are known. Compute a load composition in such a way that the value (price) of the load is maximum. Input: Output: Load composition value =79000 400kg of gold and 600kg of copper Hints: - Again, implemnent your solution in Python or C++ or both. - You'll see that the above example is very easy to work out. We hardly need a program to do it for us! Experiment with different and more complex inputs with a wider range of items. If you are really feeling ambitious you could produce the input randomly so you have less control over it; also you could produce the maximum load randomly. (NB 'random' would need to be within realistic parameters). - As with the other advanced task this week, you need to construct the output strings
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
