Unit 1: Applied Computing
Area of Study 2: Programming
Outcome 2
Interpret teacher-provided solution requirements to design, develop and evaluate a software solution using a programming language.
Examples of learning activities
Detailed example
Developing software solutions – programming skills development
To assist students who have limited programming knowledge, the teacher could provide them with partially written programs. These programs may consist of missing lines of code, or lines of code that are incomplete, or a combination of both. In the commercial world not all programs are written from scratch. Instead, many businesses employ an approach involving a type of ‘skeleton’ programming framework, where the program contains common pre-written lines of code but omits the intended functionality of a program. This helps in ensuring consistency in how programs are written in the organisation, which makes the code easier to read and simpler to maintain. For this reason, the teacher could consider providing the less experienced students with skeleton code (i.e. a working program that has had some lines of code removed and/or some lines of code that are only partially written) to help scaffold student learning, especially in the initial stages of the programming area of study.
Examples of practice activities that students might complete are:
- Arrays
- declare and initialise a one-dimensional array
- insert elements into an array, then print the array
- loop through an array, printing each element of the array
- change the value of an array element, printing the array before and after the change
- concatenate the elements of the array, then print the result of the concatenation
- Records and files
- open an existing ‘txt’ file, then close it (note: it is a good programming practice to close a file when finished with it)
- open an existing ‘txt’ file, then read a fixed number of characters of the first line (or record) of the ‘txt’ file into a variable which is then printed
- open an existing ‘txt’ file, then read the first line (or record) of the ‘txt’ file into a variable which is then printed
- write a record to a file, creating a new file in the process or replacing an existing file
- append a new record to an existing file
- read the records from an existing file into an array or list, sort the array or list, and then write contents of the array or list to a new/existing file
- use getName (or similar, depending upon the programming language used) to return the name of a file as a string
- delete a file and its contents and rename a file
- develop code for exception handling to test whether a file exists or not.
Note: As part of these programming practice activities, students should use comments to justify their use of appropriate features of the programming language.