0% found this document useful (0 votes)
2 views7 pages

3practical Paper Short Note Discussion 3

The document covers essential programming concepts for Cambridge OL/IGCSE Computer Science, including variables, constants, data types, looping structures, procedures, functions, local and global variables, library routines, arrays, and file handling. It explains the definitions and examples of each concept, emphasizing the importance of meaningful naming and the use of arrays for data organization. Additionally, it highlights the significance of file handling for data storage and retrieval in programming.

Uploaded by

vinodimunasingha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

3practical Paper Short Note Discussion 3

The document covers essential programming concepts for Cambridge OL/IGCSE Computer Science, including variables, constants, data types, looping structures, procedures, functions, local and global variables, library routines, arrays, and file handling. It explains the definitions and examples of each concept, emphasizing the importance of meaningful naming and the use of arrays for data organization. Additionally, it highlights the significance of file handling for data storage and retrieval in programming.

Uploaded by

vinodimunasingha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Cambridge OL/IGCSE

2025
COMPUTER SCIENCE

PRACTICAL PAPER SHORT


NOTE DISCUSSION 3

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.

Variables/Constant should be given meaningful names.

Declare the constants and variables to

2) Basic data types


i)integer – a positive or negative whole number EX:50
ii)real – a positive or negative number with a fractional part or decimal EX:50.69
iii)char – a variable or constant that is a single character EX:A
iv)string – a variable or constant that is several characters in length. EX:”Smith”
v) Boolean – a variable or constant that can have only two values TRUE or FALSE.
3) Looping(iteration)
These are:
» Count-controlled loops (FOR LOOP)
» Pre-condition loops(WHILE LOOP)
» Post-condition loops(REPEAT-UNTIL)
4) String Handling

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.

7) Local and global variables

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.

Declaring and populating arrays with iteration


1)One-dimensional arrays
A one-dimensional array can be referred to as a list.

//1D array Declaration syntax


DECLARE Arrayname:ARRAY[start index:Last index] OF Data type
//Input the numbers
For index0 To 9
Input num
Mylist[index]num
Next
//output the numbers
For index0 To 9
OUTPUT Mylist[index]
Next

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy