We help IT Professionals succeed at work.

# What are the logical parts?

on
246 Views
What are the logical parts that are necessary to make an iterative control structure useful?
Comment
Watch Question

## View Solution Only

Senior Software Engineer (Avast)
CERTIFIED EXPERT

Commented:
This question doesn't really make any sense. It's like saying, "What are the logical parts that are necessary to make a building useful?". Can you re-phrase it maybe?

Commented:
I guess what I'm trying to say is I need help explaining  the logical parts that are necessary to make an iterative control structure useful.
Senior Software Engineer (Avast)
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
CERTIFIED EXPERT

Commented:
To add to evilrix... For iteration you need not only a predicate but also something that enables it to be finite -- some functionality that leads to the next step. It can be increment or decrement of an integer variable, moving the iterator, whatever.

I personally consider the iteration control structure useful when it nicely reflect our mental picture of solving the problem. I mean, not our mental picture how the procesor should do it. The matematical approach is a good example: "for each element of the..." set, for example.

From that point of view I like the Python generalisation of the for loop:

for element in "iterable":
process the element

Then whatever is iterable, its processing can be prescribed via that simple syntax.

To summarize, the "necessary" or "useful" can be classified from low-level point of view or from high-level abstractions point of view.
CERTIFIED EXPERT
Top Expert 2009

Commented:

http://www.cplusplus.com/doc/tutorial/control.html

Commented:
Yes
CERTIFIED EXPERT
Top Expert 2009

Commented:
>> Yes

Then you should have already known this ;) That tutorial explains all parts of all loop types in detail :) You might want to refer to it when you have further problems ...
Unlock the solution to this question.

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.