Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 2/Programming Assignment

Sent here from Programming Assignment 2.

Deutsch · English · Français · Български · 中文(中国) · 日本語

2F - Programming Assignment (author: Tao Yue, state: unchanged)

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. You should type in the numbers separated by spaces from the keyboard: 45 7 68 2 34.

The output should now look like this:

text
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.


From the Free Pascal wiki, page "Basic Pascal Tutorial/Chapter 2/Programming Assignment", as it stood on 2022-08-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 4, last changed by WikiArchive .

Edited on wiki.freepascal.org by 7 people, 2007–2022

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
KeesNew page: 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 spec...
Kees
Kees
Jwdietrich
Swen (minor)
FTurtle
Derakun
BrinyUndo revision 94600 by Derakun (talk)
FTurtle
Kai BurghardtKai Burghardt moved page Programming Assignment 2 to Basic Pascal Tutorial/Chapter 2/Programming Assignment: tidy up main name space: create subpage hierarchy for basic Pascal tutorial [cf. [[Special: Pe... (minor)
Kai Burghardtbypass redirects [cf. discussion]
Kai Burghardtbypass language bar/categorization template redirect [cf. discussion] (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.