Sign in Join
Wiki copytemporary

Basic Pascal Tutorial/Chapter 2/Programming Assignment: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
112F - Programming Assignment (author: Tao Yue, state: unchanged)
22
33Again find the sum and average of five numbers, but this time read in five integers and display the output in neat columns.
44
55Refer to the original problem specification if needed. You should type in the numbers separated by spaces from the keyboard: `45 7 68 2 34`.
66
77The output should now look like this:
88
99`Number of integers = 5`\
10-\
10+
1111`Number1:      45`\
1212`Number2:       7`\
1313`Number3:      68`\
1414`Number4:       2`\
1515`Number5:      34`\
1616`================`\
1717`Sum:         156`\
1818`Average:      31.2`
1919
2020As an added exercise, you can try to write the output to a file. However, I won't use files in the problem solution.
2121
2222---
2323*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](/wiki-contact).*

Back to history