Pick one or more examples from everyday life and write a


Pick one or more examples from everyday life and write a WHILE and a DO-WHILE loop.

For example, the classic "lather, rinse, repeat" on a shampoo bottle could be written as:

while (hair dirty)

{

Lather;

Rinse;

}

or as

do

{

Lather;

Rinse;

} while (hair dirty);

While my examples are very similar they are not logically equivalent. If a person has clean hair, they will not wash at all in the first example. In the second example they will lather and rinse at least once. Are your examples equivalent? (It depends on how you set it up).

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Pick one or more examples from everyday life and write a
Reference No:- TGS01034434

Expected delivery within 24 Hours