You Should Be Able to Understand and Be Able to Use These Computational Constructs

Total Page:16

File Type:pdf, Size:1020Kb

You Should Be Able to Understand and Be Able to Use These Computational Constructs

Computational Constructs 2015-6 You should be able to understand and be able to use these computational constructs:  sub-programs/routines, defined by their name and arguments (inputs and outputs), including: o functions o procedures o methods  scope, local and global variables  parameter passing (value and reference, formal and actual)

You should be able to understand and be able to use these data types and structures:  string  numeric (integer and real) variables  Boolean variables  1-D arrays, records  sequential files (open, create, read, write, close) Sub-programs

The terms sub-program, subroutine, procedure, method and function are used by computer scientists to describe a clear independent block of code within a program. Each block can be reused if necessary, either within the same program or as part of a module within a module library. Sometimes the terms can become confusing, especially as they can appear to be used interchangeably or in similar contexts. The terms sub-program and subroutine are fairly generic and simply describe the fact that there is an independent block of code that can be called upon, re-used or accessed by the main program. When a main program ‘calls’ a sub-program it will run the code contained within the sub-program.  A sub-program is a block of code that can be called and accessed by a main program  Procedures are sub-programs designed to perform a series of commands with values sometimes passed from or to another part of the program  Functions are sub-programs designed to always return a single value to another part of the program  Method is the term used to describe procedures and functions when using object-orientated languages such as Java

2 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Local and global variables

Sub-programs, functions, procedures and methods make use of variables. You can learn more about the concept of a variable in Data types and constructs. Variables can be declared as global variables or local variables. A global variable places greater demand on system resources as it needs to be retained in memory (RAM) throughout the entire execution of a program. This ensures that the value of the global variable is accessible to each part of the program at all times. This can be dangerous, as errors in code can leave the value itself susceptible to accidental or unintentional change that can have a knock on effect elsewhere in the program. During the early stages of programming and at school level, the issue can seem trivial, particularly because of the fact that most programs at this level only contain a small number of variables. However, in real terms and in real commercial programs there may be hundreds or thousands of variables in use during the execution of a program. On the other hand, a local variable is declared within one specific sub-program of a larger main program. During the execution of this sub-program, the values of local variables will be held in RAM. Upon completion of the execution of this sub-program the variable is no longer retained in RAM and is therefore more efficient in terms of demands on system resources. However, when using local variables instead of global variables there are still some problems:  How can the value of a variable needed in one sub-program be accessible to another sub-program that also needs the value during execution without needing to use a global variable?  What happens if the value of a variable is to change from one sub-program to another, particularly on a temporary basis? The solution to these issues is to use what is called parameter passing. Parameter passing will allow the values of local variables to be accessed, updated and used within sub-programs without the need to create global variables for this purpose.

Scope of variables

The scope of a global variable is the entire program. The scope of a local variable is the sub-program where it has been declared.  Global variables can be accessed by the main program and every sub- program or module at all times. They are always present in RAM during execution

3 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6  Local variables can only be accessed within the sub-program that they have been declared/created within. They are only present in RAM during the execution of the sub-program where they are located.  Parameter Passing is used to allow the values of local variables to be passed to sub-programs without the need to use global variables. The value or a copy of the value of these variables is passed as a parameter to and from sub- programs as necessary.

Example using a procedural language

Analysis Program specification Design, write and test a program to  prompt the user to enter the length, breadth and height of a rectangular room  calculate the floor area and wall area  calculate a. the number of carpet tiles for the floor b. the number of rolls of wallpaper for the walls c. the number of litres of paint for the ceiling  display the results of these calculations

4 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6

Design – top down design with stepwise refinement The main steps of this program could be as follows: 1. get_user inputs 2. calculate_areas 3. calculate_requirements 4. display results

The steps could be refined as follow:-

1. get_user_inputs 1.1 prompt user to enter length of room 1.2 prompt user to enter breadth of room 1.3 prompt user to enter height of room

2. calculate areas 2.1 calculate the floor area (FA = L x B) 2.2 calculate the wall area (WA = (2 x (L + B)) x H)

3. calculate requirements 3.1 no. of tiles = FA 3.2 no.of rolls paper = WA / 5 3.3 litres of paint = 2 x (FA / 4)

4. display results 4.1 display length, breadth and height 4.2 display no. of tiles required 4.3 display no.of rolls of paper required 4.4 display litres of paint required

5 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Data flow/inputs and outputs

The term 'data flow' is used to describe how data moves between sub-programs in a software development language. Data either flows out of a sub-program or into a sub-program. IN - Data is passed into a sub-program as a parameter OUT - Data is passed out of a sub-program as a parameter Some programmers also use: IN/OUT - This definition is used when data is passed IN, is altered and the altered value is passed OUT In the sample algorithm shown above, the values of the variables length, breadth and height are accessible to steps 2 and 4. These values would be passed OUT of step 1 and IN to steps 2 and 4. In this case, no alteration is made to the values held these variables in any of the subsequent steps. Had any of the steps altered the values of the variables, it would have been possible to use IN/OUT. Here is a structure diagram that shows the subprograms and data flow in our example (a down arrow indicates data going in and an up arrow indicates data coming out):

6 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Parameters

Steps 1, 2, 3 and 4 could require sub-programs that could be created individually and be called by the main program when needed. Sub-programs can be used more than once within a main program if necessary. Each sub-program in the main program includes brackets at the end of the sub- program name: 1. call get_user_inputs() 2. call calculate_areas() 3. call calculate_requirements() 4. call display_results() Actual parameters Within these brackets it is possible to include something known as an 'actual parameter'. For example, the length that is given a value in step 1 is needed within steps 2 and 4. To ensure that the value of a variable is accessible within the other steps, the variable would be passed as a parameter to each of these steps. When the parameter is stated in brackets within each sub-program call, it is known as an actual parameter. Without including the actual parameter, the values of the local variable within the subprogram would not be accessible to the other sub- programs. This is because these sub-programs exist independently of the main steps and within their own specific block of code. Actual parameters are sometimes called arguments. An argument/actual parameter is given the value of related local variables at run time. Usually, local variables that are going to be passed as parameters would contain no value until a value is assigned within a sub-program. For example, our main program would look like this: 1. Call get_user_inputs(length, breadth, height) 2. Call calculate_areas(length, breadth, height, FA, WA) 3. Call calculate_requirements(FA, WA, tiles, rolls, litres) 4. Call display_results(length, breadth, height, tiles, rolls, litres)

7 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6

Formal parameters When the program runs it will call and execute step 1 followed by steps 2, 3 then 4. Each procedure has its’ formal parameters listed on the first line: Private Sub get_user_inputs(ByRef length As Single, breadth As Single, height As Single) 'prompts user to enter length, breadth and height length = InputBox("Enter length of room in metres") breadth = InputBox("Enter breadth of room in metres") height = InputBox("Enter height of room in metres") End Sub Private Sub calculate_areas(ByVal length As Single, breadth As Single, height As Single, ByRef FA As Single, WA As Single) 'calculates floor and wall areas FA = length * breadth WA = 2 * (length + breadth) * height End Sub Private Sub calculate_requirements(ByVal FA As Single, WA As Single, ByRef tiles As Integer, rolls As Integer, litres As Integer) 'calulates number of tiles, rolls of paper and litres of paint tiles = Int(FA + 1) rolls = Int((WA / 5) + 1) litres = Int((2 * FA / 4) + 1) End Sub Private Sub display_results(ByVal length As Single, breadth As Single, height As Single, tiles As Integer, rolls As Integer, litres As Integer) 'display results in text box on form txtDimensions.Text = "L= " & length & " B= " & breadth & " H= " & height txtTiles.Text = "You need " & tiles & " carpet tiles" txtPaper.Text = "You need " & rolls & " rolls of wallpaper" txtPaint.Text = "You need " & litres & " litres of paint" End Sub

Parameters allow the programmer to assign values to variables that can then be used in later steps. Ordering and naming actual and formal parameters

In the previous example, the name of the actual parameter is the same as the name of the formal parameter. This is deliberate to help exemplify the fact that the values are linked and allow the same data to pass between sub-programs. At university level and in the world of work it is normal for the actual and formal parameters to have different names. This is because it is not unusual for a procedure or function to be called on more than once from different parts of the same program. For example, a procedure could be used to find the smallest value in an array. It may be used several times during execution with different local variables from the main program passed as parameters on each occasion.The names of the actual parameters would probably be different depending on which array is being used, for example:-- Call find_minimum(test1_marks(), test1_min) Call find_minimum(test2_marks(),test2_min) The formal parameters may be:- Private sub find_minimum(ByRef num_array(), ByVal min) 8 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Software development environments match actual and formal parameters by their location on the parameter list rather than by their name. Values as actual parameters It is also possible to include actual parameters that are just values rather than data held within a local variable. Using values for actual parameters can be useful where programmers wish to pass static values into a procedure or function. An example may be passing the lower and upper limit of a range as actual parameters. The number of weeks in a year would have a lower value of 1 and an upper value of 52. If the programmer wished to ask the user to enter a week of the year, they could make use of an input validation function. The function called InputValidNumber is called with actual parameters of 1 and 52. weeknumber = InputValidNumber (1,52) The values 1 and 52 would be passed to the function. The function declaration could be: FUNCTION InputValidNumber (INTEGER lower, INTEGER upper) RETURNS INTEGER The formal parameter called 'lower' would assume the value 1 and the formal parameter upper would assume the value 52. The rest of the function is not shown here as the key point is to understand that actual parameters can be passed as static values if necessary. Passing parameters by value and by reference

When parameter passing occurs, it can happen in one of two forms. Passing by value or passing by reference. Passing parameters by value

When a parameter is passed by value, the system creates a temporary copy of the variable for use within the procedure.

When the procedure ends, the temporary copy is discarded.

If the procedure has made any changes to the value of the parameter, then those changes are lost when the procedure ends. The value of the original main program variable is unchanged.

9 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 The main drawback of passing by value is that this places greater demand on system resources. As well as having to store the value of the local variable, it is also necessary to store a copy. The main advantage of passing by value is that the original local variable is protected from accidental or unnecessary change.

10 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6

Passing parameters by reference When a parameter is passed by reference, the system does not create a new temporary variable. The procedure refers to the actual variable.

If the procedure has made any changes to the value of the parameter, then those changes are kept when the procedure ends. The value of the original main program variable has been changed by the procedure. As a result, any subsequent sub-programs that make use of the variable would receive the altered, updated value. Passing arrays By their nature, arrays are generally demanding on system resources. In a program for the health service, there may be an array holding thousands of different names. If this array were passed by value then it would need to be copied. Copying the array would become inefficient and place a high load on memory. For this reason, arrays are generally passed by reference. However, advances in processor technology have led to a belief that in some contexts the inefficiency would be negligible. It depends on the size of the array and the power of the system but in most cases arrays will be passed by reference rather than by value. Programming languages Different programming languages apply different rules when passing parameters. In some languages it is not possible to pass by value. In terms of the theory of this revision guide, it is important to understand the difference between passing by reference and passing by value, even if the language you are using does not support both methods of parameter passing.

11 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Procedures v functions

Procedures and functions are both types of sub-program. In object oriented environments they are known as methods and no distinction is made between the two. However, in procedural languages the two are used for different tasks. In procedural languages a procedure is a sub-program that will perform a series of commands such as sorting a list of numbers or generating an output. Procedure The following is an example of a procedure and includes formal parameters. This procedure will output the result of a class test as either pass or fail. The three formal parameters are mark, award and threshold. PROCEDURE DisplayResult (INTEGER mark, STRING award, INTEGER threshold) IF mark > = threshold THEN SET award TO "Pass" ELSE SET award TO "Fail" END IF SEND award TO DISPLAY END PROCEDURE Calling a procedure In order to call this procedure from the main program the following statement is necessary. DisplayResults (score,grade,50) This line of reference language would call the procedure for execution and also contains a list of the actual parameters being passed. In this case the actual parameters are score, grade and the value 50. Remember that software development languages would match the actual and formal parameters by their location rather than their name. The fact that the number 50 is an actual parameter simply means that the threshold formal parameter would assume the value of 50. Functions In procedural languages a function is a sub-program that will return a single value such as the average number from a list or a specific value from an input validation algorithm. As a function will return a value to another part of the program, it is necessary to specify the type of data that a function will return. This can be seen beside the parameter list. A function also requires a return statement at the end of the function. This statement identifies the local variable used to return a value once the algorithm has been executed. Functions that are created by a programmer are known as user defined functions. This is an example of a function created to find the maximum value in a list.

FUNCTION FindMax (REAL testscore[]) RETURNS REAL SET maximum TO testscore [0] FOR counter FROM 1 TO 9 DO 12 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 IF testscore[counter] > maximum THEN SET maximum TO testscore[counter] END IF END FOR RETURN maximum

When called, this function would return the value of the local variable called maximum. Calling a function The main program may contain a variable called highest that wishes to receive the returned value from the function. In this case the function would be called as follows: Highest= FindMax (testscore []) Pre-defined functions Most high level languages will make use of pre-defined functions. A pre-defined function is built into the software and does not need to be created by a programmer. Pre-defined functions often exist for carrying out common tasks, such as finding an average number or determining the length of a string. Another example may be the mod function which will calculate the remainder of a value that has been divided a set number of times. For example: SEND 7 MOD 2 TO DISPLAY This would print 1 on the screen. Methods The term method is used in object-oriented languages to describe procedures and functions without making a distinction between the two.

13 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Data types and constructs

This section looks at: Data types  String  Integer  Real  Boolean Data constructs  1-D arrays  Records Sequential files  Create  Open  Close  Read  Write Variables Variables are used to identify storage locations in memory. When a variable is declared, a storage location is allocated in RAM. Programmers create a name for a variable so that they can reference the storage location and use the value held there throughout the source code.

14 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Data types

All variables require a data type. The data type is used to define the type of data that the variable will hold in memory. Different data types have different rules about how the data can be used. String The string data type is used to store characters. The term “characters” includes:  lower case letters  UPPER CASE LETTERS  Alpha numeric data e.g a postcode - G49 1JR  Symbols e.g ( $ ! = String data types can be used in different ways. It is useful to understand:  Substrings  String functions  Concatenation  Symbols e.g ( $ ! = Substrings We can extract part of a string to form a substring. If we want to use only the first three characters of the string we can write code that will remove those letters. String functions As well as being able to extract part of a string to create a substring it is also possible to perform string functions. Common examples include:  Length  Uppercase  Lowercase  Trim In the examples listed it would be possible to create code that would calculate the length of a string, alter a string so that all characters were in uppercase form or alter a string so all characters were in lowercase form. The trim string function would remove white space (spaces) that appear at the beginning or end of a string value. There are many other string functions that can be used to alter, check or split strings depending on the programmers needs. Concatenation Concatenation is term used to describe the process of joining together separate strings and/or substrings. For example, the separate strings of "Computing" and "Science" could be concatenated to give the single string of "ComputingScience". Example

15 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 If there are two string variables called forename and surname they could be concatenated and stored in a variable called fullname. Pseudocode would use the & symbol to represent concatenation and to distinguish this from adding to numerical values, where the + sign would be used. In pseudocode this would be expressed as: SET fullname TO forename & surname If the forename variable held the characters "Jane" and the surname variable held the characters "Kane" the fullname variable would hold the characters "JaneKane". Integer, Real and Boolean data types Integer The Integer data type is used to store whole numbers, including negative numbers. Integer data can be treated mathematically and it is possible to perform a range of mathematical operations on this type of data using the operators +, -, *, /, = and ^ as well as others. Values such as -43, 92, 0, 18 are all examples of suitable data for an integer variable. Real Real data types are used when floating point numbers need to be stored. Like the integer data type, it is possible to perform a range of mathematical operations on this type of data. Values such as 1.54, 7.77, 8.2657 can be stored as real variables. It is possible to define how many values are held after the decimal point, allowing for the desired level of accuracy for specific tasks. Boolean The Boolean data type is used to store True or False values. This data type can only hold two states. Programming languages allow for the use of the terms True and False but the data will be held as a 1 (True) or 0 (False).

Modifying variables Declaration Declaration is the term given to the process of declaring variables. In some languages the programmer will need to declare the variables and their data types before they can be used. In the SQA reference language, declaration takes place by using the DECLARE keyword. The term INITIALLY sets an initial value for the variable. In the example shown below, the initial value of total is set to 0. DECLARE total INITIALLY 0 It is also possible and often recommended to include the data type when a variable is declared. DECLARE total AS INTEGER INITIALLY 0 The example shown above makes it clear that the variable named ‘total’ is an integer with an initial value of 0.

16 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 In some languages there is no need to declare variables; the environment will detect the data type of the variable depending upon the values that are assigned when the variable is first used. Variables can be declared as global variables or local variables. If they are declared as global variables then the data held can be accessed throughout the entire program. If they are declared as local variables then the data held can only be accessed within one subroutine/module/procedure/function. Local variables cannot be accessed anywhere else in the program. You will learn more about global and local variables later in the course. Assignment Assignment describes the process of assigning a value to a variable. Examples of assignment are shown in the table below. In this example we are assigning the string value 'Jane' to the variable forename in a range of different languages. In pseudocode this could be expressed as: SET forename TO "Jane" Assigning a value to a string variable Java String forename = "Jane"; LiveCode put "Jane" into forename Comal forename$:= "Jane" True Basic LET forename$= "Jane" Visual Basic / Visual Studio forename = "Jane" Python forename = "Jane" Pascal forename = 'Jane'; Xojo (REAL Basic) forename = "Jane"

17 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 1-D Array 1-D Arrays allow programmers to store groups of data, provided that the data is of the same data type. If you wanted to store a list of Scottish cities you could create a 1-D Array. When a programmer creates a 1-D Array they can define the number of variables that will be held in a list. In order to identify each variable in the list it is necessary to create an index. The index will start at the value 0. Using the example of storing the name of Scottish cities, a 1-D Array could be created with seven different index values used to identify each item of data. In reference language this could be represented as: DECLARE scottishCities INITIALLY ["Glasgow", "Dundee", "Perth", "Aberdeen", "Stirling", "Edinburgh", "Inverness"] Scottish cities 0 1 2 3 4 5 6 Glasgow Dundee Perth Aberdeen Stirling Edinburgh Inverness It is common to identify the number of elements that need to be stored in the array when you use software development langugages. As an example, a 1-D Array for Scottish cities held in Visual Basic could be represented as: Dim scottish_cities (5) as String The value shown in brackets determines the number of elements that are held within the 1-D Array. It also allows the programmer to reference a location in order to find a value. In the example shown, the value of scottish_cities(5) is Edinburgh. When creating a 1-D Array it is necessary to:  Give the array an appropriate name  Define a data type for the array  State the number of elements (index) to be held in the array

String as a 1-D Array Some programming languages treat a string as a 1-D array of characters. In this case there would be an additional data type CHARACTER which can store any single alphanumeric character. There would then be an additional complex data type STRING which would be a 1-D array of characters. SET myTown[6] TO ["G", "l", "a", "s", "g", "o", "w"]

18 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Records

Records in this part of the course are different to records that are used within the ISDD unit. While there are similarities in how records are structured in both units it is important to be able to explain the purpose of records in each context. In software development, a record is a programmer defined data type. 1-D Arrays can only store data of the same data type. It is not possible to use a 1-D Array to store multiple data types at the same time. If you want to hold related data that is of different data types it is practical to use a record type. If we wished to store information on Scottish cities, namely the city name, population, area in km and whether or not it was the capital city, we would need to use four separate arrays. Using a record would allow us to store the data for each city together. A record type to store information on each city could look like this when created in the reference language: RECORD cityData IS {STRING cityName, INTEGER population, INTEGER area km, BOOLEAN capital} The line shown above creates a template for how a record type would be stored, it is not yet populated with any values. Individual variables for each city could be declared and initialised as follows: DECLARE Glasgow INITIALLY CityData ( “Glasgow” , 596550, 176, FALSE ) DECLARE Dundee INTIALLY CityData ( “Dundee”, 147285, 67, FALSE ) DECLARE Perth INTIALLY CityData ( “Perth”, 46970, 21, FALSE ) DECLARE Aberdeen INTIALLY CityData ( “Aberdeen”, 220420, 186, FALSE ) DECLARE Stirling INTIALLY CityData ( “Stirling”, 36142, 105, FALSE ) DECLARE Edinburgh INTIALLY CityData ( “Edinburgh”, 487500, 264, TRUE ) DECLARE Inverness INTIALLY CityData ( “Inverness”, 48201, 36, FALSE )

19 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6

Storing multiple records As records are treated as data types they can be held within a single array to allow for storage of more than one record within the same structure. Essentially an array of records. If we were to apply the use of a record we could allow the program to store all of the desired information for each city within an Array called scottish_cities. Instead of the four Arrays with four data types, the data type for the array of records would be the name of the record type, in this case cityData. We would now be able to store all of the data for each city within an array called Scottish_Cities holding values of the data type CityData. DECLARE scottish_cities as ARRAY of cityData INITIALLY [Glasgow, Dundee, Perth, Aberdeen, Stirling, Edinburgh, Inverness ] The table below simplifies the way that this data would be held in memory.

Each programming language will use a different method of defining a record type. In some languages the term record is not used but an equivalent construct exists. In other languages it is not possible to create a record in the way that we would understand the theory for this course. In an object oriented context a class is a record with associated methods. A class called city could hold all of the instance variables and methods that would be required for each city. If you aren’t sure about how a class could be used in an object oriented environment then see the notes in section 1: Languages and Environments. If you are using object oriented programming languages you may want to research the use of records in procedural environments to get a better understanding of how they are applied in other languages.

20 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 Sequential files and file operations

Sequential files It is often necessary to access data held in a sequential file. Sequential files hold data in a set sequence/order. A programmer may want to use the data that is saved in a sequential file. File operations File operations allow programmers to create, access, edit and delete data held in sequential files. When files are opened, closed or amended the file management and memory management functions of the operating system will be active. You will learn more about the operating systems in another section of the course. Create The Create operation allows for the creation of a new sequential file. Sometimes the create operation is implicit when the Open operation is used. This means that if the program attempts to open a file that does not exist, it will automatically create a new file. In this case the file name is english_towns. CREATE english_towns Open Open will open a sequential file so that the program can read data from the file or write data to the file. OPEN english_towns Close Close will close a sequential file when it is no longer needed. This will reduce pressure on RAM as the file will not be held there anymore. CLOSE english_towns Read Unlike Create, Open and Close there is no Read command used in pseudocode. To Read from a sequential file means to take the data from the file and store it in a variable, array or record for future use in the program. Before you can read from a file you have to open the file. Once the file is open it is possible to create code that will read specific data from the file. In this example we presume that the file called english_towns contains a sequential list of fifty town names. OPEN english_towns FOR counter FROM 0 TO 49 DO RECEIVE townname [counter] FROM english_towns END FOR CLOSE english_towns Write Write follows the same principle as read. However, when you write to a file you are often sending the values held in variables, arrays and records out of the program for storage within 21 Higher Computing Science – Software Design & Development – Bitesize Computational Constructs 2015-6 a sequential file. In this example we are presuming that the file has just been created and does not yet hold any town names. The pseudocode is designed to write this data to the sequential file. OPEN english_towns FOR counter FROM 0 TO 49 DO SEND townname [counter] TO english_towns END FOR CLOSE english_towns When using software development environments, different languages will use different syntax for performing file handling operations. While the pseudocode that you need to be able to read and understand uses the generic terms SEND and RECEIVE, some languages will make use of read and write. Be sure to learn how to implement create, open, close, read and write operations in the language that you are using in class.

22 Higher Computing Science – Software Design & Development – Bitesize

Recommended publications