Question: Implement The Function Solve (Weighto, Weight1, Weight2) That Takes 3 Integer Arguments: Weighto, Weight1 And Weight2. These Values Represent The Weight Of The Packages Available

 

 Implement The Function Solve (Weighto, Weight1, Weight2) That Takes 3 Integer Arguments: Weighto, Weight1 And Weight2. These Values Represent The Weight Of The Packages Available On The Conveyor Belts With Respective Index 0, 1 And 2. When A Conveyor Belt Is Empty, The Value Is 0. The Function Must Return The Index Of The Conveyor Belt That Has The Heaviest

Implement the function solve (weight0, weightl, weight2) that takes 3 integer arguments:

 

Implement the function solve (weight0, weightl, weight2) that takes 3 integer arguments: weight0, weight1 and weight2. These values represent the weight of the packages available on the conveyor belts with respective index 0, 1 and 2. When a conveyor belt is empty, the value is 0. The function must return the index of the conveyor belt that has the heaviest package. For example, if the values for weight0, weight1 and weight2 are 85, 100 and 90, then the expected answer is 1. In case of equality, any correct answer is accepted. The function solve (weight0, weightl, weight2) will be called successively until all the conveyor belts are empty.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!