GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

2.2 Programming - created from Mind Map

Khang Duong Computing Year 10 Englisch 1 Seite

Inhalt der Notizen (1)

Seite 1

Variables

Key words

Operators

Sequencing

SELECTION

ITERATION

Should not start with a number or contain spaces

Is a specific data type

Whole number

Real number

Boolean

String

no decimals/fractions

has a fractional part

Trueorfalse

any text that isn't meant to be calculated

Operators represent the operations that are performed on the data.

operators in Maths, e.g. +, -, /, *, ^, etc.

Boolean: AND, OR, NOT, larger, smaller, equal, not equal

Strings/characters: slicing, length, format

Addition total = amount + VAT Subtraction e.g. age = cur_year – y_birth Division divide = 5 / 2 Modular division myRemainder = 5 MOD 2 (find a remainder) Integer division intDivision = 5 DVI 2 Multiplication totalCost = cost * 0.2 Exponential area = 3.1 * radius^2

Numbers: addition, subtraction, division, modular division (division with a remainder), integer division, multiplication, to-the-power-of, negation

Sequencing allows a programmer to solve complex tasks through a number of simple steps.

BENEFITS

NEGATIVES

Each line follows the next Create simple programs very quickly Easy to follow for a small program Fundamental principal of a program - Starts at the top, finishes at the bottom

Not at all efficient Becomes very difficult to follow with large programs Extremely hard to maintain

Selection changes the flow of a program, depending on a set of conditions, it is used for validation, calculation and making sense of a user’s choices.

The use of selection allows a computer to “think” – make decisions

Apart from efficiency in reducing the number of lines of code we would run, we need programs to make decisions based on a set of criteria or condition. If the condition is true, we run this set of lines of code, if the condition is false – we run some other set of lines.

The two common types of iteration: WHILE (condition-controlled) and FOR COUNTER (counter-controlled)

loops are called “iteration” because they run through or “iterate” through multiple similar items of data.

FOR COUNTER

WHILE

This is the loop for when we know in advance how many times we want to loop back to the start, so we keep count and check against the number of repetitions (iterations) that are required, using a counter.

we use counters as virtual beads to know when to stop.

Sometimes, we don’t know in advance how many times we want to repeat something, so we use “conditional” or “condition-controlled” loops. These loops evaluate a Boolean condition every time they run (either in the beginning or the end of an iteration) and if it is true – they carry on, otherwise, the loop stops.

These loops are better for user interfaces, or in general to allow interaction of the program with the outside world.

Informationen

Beschreibung
Year 10 Computing Notiz am 2.2 Programming - created from Mind Map, erstellt von Khang Duong am 18/01/2019.
Erstellt von
Khang Duong
Aufrufe
8
Verlauf
  • Erstellt von Khang Duong · 18 Jan 2019
  • Zu Notiz kopiert von Khang Duong · 18 Jan 2019
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck