Pieter J. Berkel's Web Site
Home > Teaching & Courses > Learn Pascal
Home Page
Photo Gallery
Travel Journal
My Teaching
 - Applied Internet Tech
 - Learn Pascal
My Resume
Contact Details
Learn Pascal
2F - Programming Assignment

Again find the sum and average of five numbers, but this time read in five integers and display the output in neat columns.

Refer to the original problem specification if needed. The numbers are:
     45 7 68 2 34

The output should now look like this:

      Number of integers = 5

      Number1:      45
      Number2:       7
      Number3:      68
      Number4:       2
      Number5:      34
      ================
      Sum:         156
      Average:      31.2

As an added exercise, you can try to write the output to a file. However, I won't use files in the problem solution.


Previous lesson

To solution

Contents

Index

E-mail me

Copyright © 2002-2012 Pieter J. Berkel. All rights reserved.