In this chapter, we start by describing how programmers can control the execution paths of programs using various branching conditionals and looping structures. These branching/looping statements act on blocks of instructions that are sequential sets of instructions. We first explain the single choice if else and multiple choice switch case branching statements, and then describe the structural syntaxes for repeating sequences of instructions using either the for, while or do while loop statements. We illustrate these key conceptual programming notions using numerous sample programs that emphasize the program workflow outcomes. Throughout this chapter, the leitmotiv is that the execution of a program yields a workflow of instructions.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2009 Springer-Verlag London
About this chapter
Cite this chapter
Nielsen, F. (2009). Conditional Structures and Loops. In: A Concise and Practical Introduction to Programming Algorithms in Java. Undergraduate Topics in Computer Science. Springer, London. https://doi.org/10.1007/978-1-84882-339-6_2
Download citation
DOI: https://doi.org/10.1007/978-1-84882-339-6_2
Published:
Publisher Name: Springer, London
Print ISBN: 978-1-84882-338-9
Online ISBN: 978-1-84882-339-6
eBook Packages: Computer ScienceComputer Science (R0)