Introduction
Flowcharting is a logic exercise. You should
outline the major points of an essay and their order before you write. A
construction worker uses a blueprint as a guide to build a house. Similarly, the
purpose of flowcharting exercises is to plan the operations, (or steps), and
sequence, (or order), for computer programs. If the programmer makes mistakes in
either of these areas the program may not work or will produce surprising
results.
Exercise 1
Trace the flowchart below by hand and note the
program output, put the result in a text file.

Exercise 2
First, create a flowchart for the following block of code.
Next, trace the program with any string input. What is wrong with this code and
how should it be fixed?
using System;
public class Echo
{
private const int EOF = -1;public static void Main(string[] args)
{
int read;
char c;
while ((read = Console.Read()) != EOF)
{
c = (char)read;
if (Char.IsLetterOrDigit(c))
{
Console.Write(c);
}
}
}
}
Exercise 3
Create a program flowchart for each of the
challenges below:
1. Read two numbers, divide the second by the first and print the
quotient.
2. Read a number and print it. Continue reading and printing numbers until
all of the numbers in the file have been read. After all numbers have been read
and printed, print the total of all of the numbers and end the procedure.
3. Generate the first twenty-five positive numbers. Print each number as it
is generated. After printing the last number, print the sum of all numbers
generated and end the procedure.
4. Print the even numbers that are less than one
hundred.
| Attachment | Size |
|---|---|
| fun_flowchart.jpg | 10.44 KB |
Latest Twitter
- Building a bridge between the #community and #corporate America http://t.co/l5CF999lTL #leadership — 2 days 19 hours ago
- Join our online workshop, and learn how to set up you website. Tomorrow 5/17 @ 2pm CST http://t.co/jOjEDl89Xh #nptech #np — 3 days 1 hour ago



