Previous page Next page Navigation bar

Calculator Programming Tutorial

Programming Building Blocks I

Control Flow I

Loops Flowchart Description

Algorithm

In the Loops page, a flowchart describes the algorithm under discussion. The algorithm in text form is:

  1. Start; the input is an integer n>1 for which a divisor is to be found.
  2. Assign 2 to d.
  3. Test whether d divides n. If so, continue with step 5.
  4. Assign d+1 to d. Continue with step 3.
  5. Return d as the divisor.
  6. End.
Structure of Loop

In the Loops page, a flowchart fragment demonstrates the structure of the loop construct. The construct consists of two flowchart symbols: a diamond, representing a decision; and a rectangle, representing processing.

The diamond is on the centerline of the diagram, with the rectangle below than the diamond, similarly on the centerline. A short arrow leads into the top of the diamond. The diamond contains the text “condition.” An arrow goes out the bottom vertex of the diamond into the rectangle. Another arrow goes out the side vertex, then goes around the rectangle, returns to the centerline, and points down. The rectangle has the text “Body.” An arrow goes out the bottom of the rectangle, up around the rectangle and the diamond, and joins the arrow leading into the diamond.

Click here to return to the Loops page.

[ Previous page | Top of page | Next page ]

Previous page Top of page Next page Navigation bar

Copyright © 2001 Brian Hetrick
Page last updated 30 December 2001.

Brian’s Casio Calculator Corner

Home

Programs

Tutorial

Preface

Introduction

Fundamentals

Building Blocks I

Introduction

Comments

Data Types

Numbers

Variables

Expressions

Control Flow I

Introduction

Sequences

Alternatives

Loops

Composition

Control Flow II

Subprograms

Basic I/O

Algorithms

A First Program

Examples

Exercises

Answers

Modularization

Data Structures I

Recursion

Program Attributes

Building Blocks II

Algorithm Analysis

Structuring

Data Structures II

Abstract Types

Objects

Problem Analysis

Reference Card

References

Puzzles

Site Information

Your Privacy

Site Map

E-mail

Site Technical Data