Computer Science 30
4.0-Programming & Design
 

Writing a Computer Program

All computer operations can be described as input, processing or output. To start off simply, if we make the assumption that the user is going to enter the temperatures at the keyboard and that the average temperature will be calculated with the click of an <Average> button, then the following items and controls are required:

  1. Labels for the title of the interface form and text boxes.(output)
  2. A text box to receive input from the keyboard.(input, output)
  3. A button to tell the CPU to add the entered amout to a variable (storage location).(input, processing)
  4. A text box to show the accumulated total value. (input, output)
  5. A variable to serve as a counter to keep track of how many numbers are being added together. (processing)
  6. A button to tell the CPU to calculate the average. (input, processing)
  7. A reset button to clear old values and reset variable to zero. (processing)
  8. A "quit" button. (input, processing)

©Copyright Saskatoon Public Schools 2005 --- Page updated Wednesday, 2008-02-13 2:20 PM