Question: 3. Weight Control (use a condition-controlled while loop) A waste bin can take up to 100kg of waste, otherwise it will break. A person may

 3. Weight Control (use a condition-controlled while loop) A waste bin

3. Weight Control (use a condition-controlled while loop) A waste bin can take up to 100kg of waste, otherwise it will break. A person may add more waste to the container until it reaches its limit. Then the container will close automatically. Write Python code (WeightControl.py) for the following algorithm: - Set the total weight of the bin to zero. - Get the weight of waste to be added to the bin. - Repeat the following steps as long as waste may be added (total weight + new weight is below 100): - Add the waste to the bin and update its total weight. - Get the weight of waste to be added to the bin. - After the loop finishes, display how much waste (in kg ) is in the bin. Test your program and save the file from the IDLE Shell window as TestControl.txt. Submit WeightControl.py and TestControl.txt . allenge for problem 3: The program prints a note if the ste did not fit in the bin any more

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 Databases Questions!