We help IT Professionals succeed at work.

What are the logical parts?

cooperk50
cooperk50 asked
on
246 Views
Last Modified: 2012-05-05
What are the logical parts that are necessary to make an iterative control structure useful?
Comment
Watch Question

evilrixSenior 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?

Author

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)
UNLOCK SOLUTION
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:
Did you read the tutorial I posted a few times already in your other questions ?

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

Author

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.
Join our community and discover your potential

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.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.