Module 3: Programming Flashcards

1
Q

What is an array (or field)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a record or structure

A

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 .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

source code vs object code vs executable code

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What strategies can be used to make a program understandable (readable and easier to edit)

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Data Items: literal,
variables & constants?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the purpose of each of the following:
{}
//
/**\
;
&

A

{} - used to enclose blocks of code
// - single line comments
/**\ - Multi-line comments
; - the end of a statement
& - input a value into a variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are format specifiers?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

C Operators

A

= assignment

ARITHMETIC OPERATORS
+ addition
- subtraction
* multiplication
/ division
% remainder after division
++ increment
– decrement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

https://drive.google.com/file/d/1LTinRUhjR9MuJA1uI3qvJ9sWjMTfsL0l/view?usp=share_link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

SO#2: explain how assemblers, compilers, virtual machines and interpreters are involved in the execution of High - level programming languages

A

https://drive.google.com/file/d/1JhgYXKwqkppgmSwFrQJeTb8hpBlL6cLU/view?usp=share_link

Presentation on Program Translation:
https://www.mentimeter.com/app/presentation/19d03f332b35d9b036249d9689b94df9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

SO#7: apply the techniques of structured decomposition to reorganise a program into smaller pieces

A

https://drive.google.com/file/d/131AovOUHl6LKJ6g7WYhhcrZskfmDfVGi/view?usp=sharing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SO#10: use text files to store data and records

A

https://drive.google.com/file/d/1_qvr-flc09FtFov-LLFQR8PnwNXVsVyb/view?usp=share_link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

SO#8: implement algorithms to solve a given problem

A

https://drive.google.com/file/d/1pZfh89b3zQjDxRxantdyKBvo0j9V0veT/view?usp=share_link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

SO#11: develop good programming style and documentation ;

A

https://drive.google.com/file/d/1WjzPUzUFpaPHq5YY21zaONI-xaronxSz/view?usp=share_link

How well did you know this?
1
Not at all
2
3
4
5
Perfectly