Skip to Content
Computer Programming for Absolute Beginners
book

Computer Programming for Absolute Beginners

by Joakim Wassberg
July 2020
Beginner
430 pages
9h 3m
English
Packt Publishing
Content preview from Computer Programming for Absolute Beginners

Chapter 7: Program Control Structures

If all of our code was simply executed in sequence, our programs would always do the same thing, no matter what data we provided them with. We must be able to control the path through the program so that some part of the code executes at the designated time, and other parts at other times, depending on the values provided by the data. For instance, only if it is cold outside do you put on warm clothes, not always. The same thing applies to our code. When things are a certain way, we want something to happen.

In a way, we can say that we, by this, will introduce some sort of intelligence, or at least some decision-making capabilities into our code. If things are this way, do this, if not, do that.

In this ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Languages: Concepts and Implementation

Programming Languages: Concepts and Implementation

Saverio Perugini
Computer Programming and IT

Computer Programming and IT

ITL Education Solutions Limited, Ashok N. Kamthane, Raj Kamal

Publisher Resources

ISBN: 9781839216862