3practical Paper Short Note Discussion 3
3practical Paper Short Note Discussion 3
2025
COMPUTER SCIENCE
DHANUSHKA NILANKA
077 0886853
Chapter 8: Programming
1)Variable and Constant
A variable in a computer program is a named data store than contains a value that may
change during the execution of a program.
A constant in a computer program is a named data store than contains a value that does not
change during the execution of a program.
5) Arithmetic operators
1
6) Procedures and functions
2
1)Procedure
Procedures with parameters
2)Functions
A function is just like a procedure except it always returns a value. Just like a procedure it is
defined once and can be called many times within a program. Just like a procedure it can be
defined with or without parameters.
8) Library routines
Many programming language development systems include library routines that are ready to
incorporate into a program. These routines are fully tested and ready for use.
A programming language IDE usually includes a standard library of functions and procedures.
3
9) Arrays
An array is a data structure containing several elements of the same data type; these
elements can be accessed using the same identifier name. The position of each element in an
array is identified using the array’s index.
4
10) Two-dimensional Array
A two-dimensional array can be referred to as a table, with rows and columns.
//Declaration of 2d array
Example
11)File handling
Computer programs store data that will be required again in a file.
File handling features
• data is saved to a file it is stored permanently.
• Data stored in a file can thus be accessed by the same program at a later date or
accessed by another program.
• Data stored in a file can also be sent to be used on other computer(s).
5
6