Squares


// Gaddis Code from text with slight mods (Wyatt)
//
using System;
using System.Windows.Forms;

namespace Squares
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void goButton_Click(object sender, EventArgs e)
        {
            // Constant for the maximum number
            const int MAX_VALUE = 10;

            // Loop counter
            int number;

            // Display the list of numbers and their squares.
            for (number = 1; number <= MAX_VALUE; number++)
            {
                outputListBox.Items.Add("The square of " + number + " is " + (number * number));
            }
        }
    }
}