Module 3: Programming Flashcards
What is an array (or field)
a data structure used to store a group of variables for a single data item (a field) i.e. variables with the same data type.
e.g. the price of a set of items
What is a record or structure
a data structure used to store a set of related variables (a record) possibly with different data types.
e.g. a record would be used to store the name, quantity and price of an item .
source code vs object code vs executable code
source code - is written in a specific programming language
Object code is produced when source code is translated by a compiler
Executable code or machine language is the language the computer can understand and execute.
What strategies can be used to make a program understandable (readable and easier to edit)
comments:
hints that are ignored by the complier.
…// - single line comments
…/* *\ - multi-line comments
descriptive variable names:
…letters & numbers but starts with letter
…camelCase format
…no spaces
…no reserved words
use of white space
…blocks and
…indents
What are Data Items: literal,
variables & constants?
data item: the smallest unit of data that can be stored
Literal: a value written exactly as it’s meant to be interpreted.
Variable: a container used to store a single data item whose value can be changed during program execution. e.g. the day of the week
Constant: a data item whose value does not change during program execution e.g. the number of days in a week.
What is the purpose of each of the following:
{}
//
/**\
;
&
{} - used to enclose blocks of code
// - single line comments
/**\ - Multi-line comments
; - the end of a statement
& - input a value into a variable
What are format specifiers?
Format specifiers are used in printf() statements to display the value of variables
%d - integers
%lf - decimal values (float/double)
%c - characters
%s - string of characters
C Operators
= assignment
ARITHMETIC OPERATORS
+ addition
- subtraction
* multiplication
/ division
% remainder after division
++ increment
– decrement
Programming Paradigms & Languages
SO#1: identify the characteristics of different programming paradigms,
SO#12: explain the need for different programming languages; and
SO#13 of 13: compare how basic concepts are implemented in different programming languages
https://drive.google.com/file/d/1LTinRUhjR9MuJA1uI3qvJ9sWjMTfsL0l/view?usp=share_link
SO#2: explain how assemblers, compilers, virtual machines and interpreters are involved in the execution of High - level programming languages
https://drive.google.com/file/d/1JhgYXKwqkppgmSwFrQJeTb8hpBlL6cLU/view?usp=share_link
Presentation on Program Translation:
https://www.mentimeter.com/app/presentation/19d03f332b35d9b036249d9689b94df9
SO#7: apply the techniques of structured decomposition to reorganise a program into smaller pieces
https://drive.google.com/file/d/131AovOUHl6LKJ6g7WYhhcrZskfmDfVGi/view?usp=sharing
SO#10: use text files to store data and records
https://drive.google.com/file/d/1_qvr-flc09FtFov-LLFQR8PnwNXVsVyb/view?usp=share_link
SO#8: implement algorithms to solve a given problem
https://drive.google.com/file/d/1pZfh89b3zQjDxRxantdyKBvo0j9V0veT/view?usp=share_link
SO#11: develop good programming style and documentation ;
https://drive.google.com/file/d/1WjzPUzUFpaPHq5YY21zaONI-xaronxSz/view?usp=share_link