Principles of Programming
Introduction
This unit introduces the learner to the fundamental concepts of computer programming, and of modern program development within a typical software development environment.
Aims
-
Learn the knowledge and skills required to write simple routines and programs.
-
Be able to design and implement effective spreadsheet macros and small utilities.
-
Provide a secure foundation upon which more advanced concepts can be built, such as object-orientation and rapid prototyping.
-
Create the practical framework to enable students to achieve useful programming skills in an object orientated programming language such as Visual Basic.
Programme Content and Learning Objectives
On completion of the programme, the student should be able to:
- Edit, compile and run programs using a modern software development environment (e.g., Visual Basic).
- Explain the theoretical and practical differences between compiled languages and interpreted languages.
- Make appropriate use of the primitive data types Integer, Long, Real, String, Boolean and Date/Time (or their equivalents in the chosen language of study).
- Create variables, use variables in assignment statements and write code to carry out simple arithmetic operations.
- Use the main control constructs of selection and iteration.
- Analyse and construct simple logical expressions using the logical operators AND,OR and NOT.
- Carry out simple processing of arrays.
- Use built in functions of the chosen language of study.
- Write and use programmer-defined functions and procedures, including the use of parameters.
Syllabus Content
Using a Modern Software Development Environment
Starting a new program; writing and editing program code; saving program files to disc; backing up program source files; loading program files back into the development environment; compiling programs; executing programs; interpreting error messages; recognising and correcting errors of syntax and errors of logic.
Compilers and Interpreters
Understanding the difference between compilers and interpreters, both in terms of their operation and in their effect on application development, deployment and maintenance.
Data Types
Integers, Long integers, Reals, Strings, Booleans, Date/Time; recognising the need for different data types; choosing the most appropriate data type for a given item of data.
Statements, Expressions and Variables
Declaring variables with specific data types; writing simple assignment statements; constructing simple arithmetic expressions. Distinguishing between expressions and statements.
Control Constructs
If-Then-Else statements; For-Next statements; test-before and test-after loops.
Logic
Truth tables; definitions of AND, OR, NOT; logical equivalence; Boolean expressions; relevance to programming.
Arrays
Declaring arrays; simple array processing – filling arrays with data; calculation of sum, arithmetic mean; finding largest/smallest element; linear search.
Built-in Functions
String related functions (e.g., length of a string, string slicing, case conversion); arithmetic functions (e.g., square root, absolute, sign, mod); type conversion functions (e.g., from Integer to Character and vice versa).
Programmer-defined Functions
Definition of simple functions; parameters and types; return types; defining return values; invocation of programmer defined functions.
Procedures
Definition of simple procedures; parameters and types; calling procedures.
|