0 votes
in Programming Languages & Algorithms by

Write an algorithm for doing your laundry. Assume that you have the detergent, bleach, fabric softener, and any other objects needed to do the laundry, and that the starting state is you standing before a washing machine with your laundry and these objects. The ending state is a set of clean, neatly folded laundry items.

1 Answer

0 votes
by

Sort out the dirty clothes based on their color and put the light colored clothes and dark colored clothes separately

Add the light colored clothes into the machine and Surf detergent to the machine?s drum

Add the bleach and, fabric softener

If the washing machine is fully automatic, read and follow the manufacturers? instructions on adding detergent in the special drawer

Else,

Add the detergent directly into the drum while applying the instruction about the use of the detergent so as to choose the right dosage.

Set the temperature, time and the washing cycle of the machine according to the requirement of the clothes

Add fabric softener and set the rinsing cycle

If the clothes are thoroughly clean, remove them after the cycle and hang them to dry,

Else

Repeat the rinsing cycle until the clothes become clean

Fold the clothes after they dry and keep them in a clean place.

Repeat the steps for the dark colored clothes.

Related questions

Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...