Previous page Next page Navigation bar

Calculator Programming Tutorial

Programming Building Blocks I

Exercises

Square Roots

Algorithm Description

The square roots exercise contains an algorithm in the form of a flowchart. Rather than describe the flowchart, the algorithm in text is as follows:

  1. Start.
  2. Compute (a+1)/2, and assign this to x0.
  3. Compute (x0 + (a/x0))/2, and assign this to x1.
  4. Compute the absolute value of x1 x0, and assign this to d; compute 10-10 times x0, and assign this to e.
  5. If d is less than or equal to e, then continue with step 7; otherwise, continue with step 6.
  6. Assign x1 to x0. Continue with step 3.
  7. Return x1 as the value of the function.
  8. End.

Click here to return to the square roots exercise 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

Control Flow II

Subprograms

Basic I/O

Algorithms

A First Program

Examples

Exercises

Square Roots

Clock Hands

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