Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pick the packages from the heaviest to the lightest one. Rules You work in an automated factory that controls a robotic arm to move packages.

Pick the packages from the heaviest to the lightest one.
Rules
You work in an automated factory that controls a robotic arm to move packages. The arm can pick packages from the conveyor belts to form a stack of packages.
The packages are sorted from the heaviest to the lightest on each of the conveyor belts. Your objective is to pick the heaviest package among the 3 conveyor belts to move it on a stack.
Implementation
Implement the function solve(weight_0, weight_1, weight_2) that takes 3 integhs arguments: weight_0, weight_1 and weight_2. 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 ronvevor helt that has the heaviest nackace For
Console output
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

Does it have correct contact information?

Answered: 1 week ago