Discussion Question
f1bsf2bsTopics
Loops
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).
- 9 years ago
- 3
Answer(0)
Bids(0)
other Questions(10)
- writing hypothesis
- disadvantages of an amendment that would BAN same-sex marriage
- Language barriers.
- Assignment 1
- PDEs
- Small fleet managers must wear many “hats”. How can this affect the fleet safety program for a small fleet? Describe negative and positive potential impact.
- SOC 313 Discussion questions Ashford university -Only 150-200 words per question
- BUS 311 Week 5 Final Paper
- OMM 622 Week 4 Assignment ( Cash Flow Statement - Ford Motor Company ) ~ ( Latest Syllabus - Perfect Tutorial - Scored 100% )
- Economics Homework