Question

Using an example from real life: (like taking a vacation, going shopping, etc) describe the process...

Using an example from real life:
(like taking a vacation, going shopping, etc)
describe the process in terms of the 3 programming control structures.
You must include all of the 3 structures.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Flow of control through any given function is implemented with three basic types of control structures:

  • Sequential: default mode. Sequential execution of code statements (one line after another) -- like following a recipe
  • Selection: used for decisions, branching -- choosing between 2 or more alternative paths. In C++, these are the types of selection statements:
    • if
    • if/else
    • switch
  • Repetition: used for looping, i.e. repeating a piece of code multiple times in a row. In C++, there are three types of loops:
    • while
    • do/while
    • for

Add a comment
Know the answer?
Add Answer to:
Using an example from real life: (like taking a vacation, going shopping, etc) describe the process...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT