BI4 - Programming

0.0(0)
Studied by 4 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/28

encourage image

There's no tags or description

Looks like no tags are added yet.

29 Terms

1
New cards

welke generation programming languages zijn er

first gen

seconde gen

third gen

2
New cards

first generation programming languages

  • machine level language

  • no translator to compile of assemble

  • made of binary numbers represented by 1s and 0s

  • instructions are execueted directly by the central processing unit

<ul><li><p>machine level language </p></li><li><p>no translator to compile of assemble </p></li><li><p>made of binary numbers represented by 1s and 0s </p></li><li><p>instructions are execueted directly by the central processing unit </p></li></ul>
3
New cards

second generation programming language : assembler

uses a mnemonic to represent each low level machine instruction or opcode;

  • load: LD instead of 1

  • add integer: ADDI insted of 5

  • store ST instead of 3

also use if variables instead of memory locations

  • “price” instead of memory location ‘6c ‘

  • “shipcharge” instead of memory location “6d”

one to one relationship between machine instructions and assemler instructions :

  • programmer still has to think in funcyion of machine instruction s

  • inherently machine specific (mnemonic name for each machine instruction)

  • conversion of program in assembler language into machine language by mean of an assembler program

  • the first assembly language was developed in 1947 by kathleen booth

<p>uses a mnemonic to represent each low level machine instruction or opcode;</p><ul><li><p> load: LD instead of 1</p></li><li><p>add integer: ADDI insted of 5 </p></li><li><p>store ST instead of 3 </p></li></ul><p>also use if variables instead of memory locations </p><ul><li><p>“price” instead of memory location ‘6c ‘</p></li><li><p>“shipcharge” instead of memory location “6d”</p></li></ul><p>one to one relationship between machine instructions and assemler instructions : </p><ul><li><p>programmer still has to think in funcyion of machine instruction s</p></li><li><p>inherently machine specific (mnemonic name for each machine instruction) </p></li><li><p>conversion of program in assembler language into machine language by mean of an assembler program </p></li><li><p>the first assembly language was developed in 1947 by kathleen booth</p></li></ul>
4
New cards

wat is een assembler

Een assembler is een programma dat verantwoordelijk is voor het vertalen van assemblytaal, een laag-niveau programmeertaal, naar machinecode die door een computer kan worden uitgevoerd.

5
New cards

third generation programming language

  • generational way to cathegorize high level computer programming languages (ex: if, for, while, )

  • cosidered high level because the are closer to human languages

  • are much more machine independent and more programmer friendly

  • each primitive corresponds to multiple machine instructions

  • first introduction in late 1950s

  • coversion from program to machine language using a compiler/ interpreter

  • all modern programming languages are 3rd generation

6
New cards

bij 3de gen zijn de vertaling naar machinetaal gevormd door

  • compilers : who will fully translate the program into machine code. (PASCAL, COBOL, MODULA) in a first phase, the compiler will checj whether there are no syntax errors in the program. These are errors against the rule of the language. The translation will begin only if no syntax errors are present

  • interpreters : where every instruction is executed immediatly after it has been translated. (python)

7
New cards

welke soorten datatypes bestaan er

  • single predifined types (enkelvoudige voorafgedefinieerde types)

  • self built single types (enkelvoudige zelfgedefinieerde types)

  • self built multiple types (array type, aggregated type, file type)

<ul><li><p>single predifined types (enkelvoudige voorafgedefinieerde types)</p></li><li><p>self built single types (enkelvoudige zelfgedefinieerde types) </p></li><li><p>self built multiple types (array type, aggregated type, file type) </p></li></ul>
8
New cards

data type : single predefined type (enkelvoudige voorgedefinieerde types) (vb)

  • integer : whole numebrs (pos, neg)

  • float (real) : with numbers after the comma

  • boolean : true/ false

  • character : symbol (e.g a letter ) / string in python

9
New cards

data type : single predefined type (enkelvoudige voorgedefinieerde types) (remarks)

  • pseudo code had no type declaration

  • some programming languages (ex python) also do not

  • => untypes languages, variales do not receive a type declaration

  • in non typed languages, the compiler/ interpreter will determine the type of each variable befor converting into machine instructions

10
New cards

data type : self built single types

1 enumerated types or list or vector

  • in older languages : identical data units

  • in modern languages (python) : mixed types

  • always one dimentional (but a list of list is possible)

  • numbr of elements can grow or shrink

  • in python : see also “tuple” and “set”

2 interval types ;

  • twenties = 20..29 (interval van integer)

  • workday = monday .. friday (interva van WeekdayList)

<p>1 enumerated types or list or vector </p><ul><li><p>in older languages : identical data units </p></li><li><p>in modern languages (python) : mixed types </p></li><li><p>always one dimentional (but a list of list is possible) </p></li><li><p>numbr of elements can grow or shrink </p></li><li><p>in python : see also “tuple” and “set”</p></li></ul><p>2 interval types ; </p><ul><li><p>twenties = 20..29 (interval van integer) </p></li><li><p>workday = monday .. friday (interva van WeekdayList) </p></li></ul>
11
New cards

self built multiple types welke soorten

  • array types

  • aggregated data type (record type)

  • file type

12
New cards

self built multiple types : array types

  • block of identical data units

  • with a fixed number of dimensions (1= row, 2= matrix, >2 = tensor)

  • with a fixed number of elements in each dimension

<ul><li><p>block of identical data units </p></li><li><p>with a fixed number of dimensions (1= row, 2= matrix, &gt;2 = tensor) </p></li><li><p>with a fixed number of elements in each dimension </p></li></ul>
13
New cards

self built multiple types : aggregated type (record type)

=> block of mixed data units

=> in python ; dictionary

combinatie van meervoudige types

<p>=&gt; in python ; dictionary </p><p>combinatie van meervoudige types </p>
14
New cards

self built multiple types : file type

unlimited data units

=> bestanden worden bewaard in het extern geheugen, alle andere variabele types in het intern geheugen

elementen van de file een per een inlezen en stockeren in het intern geheugen

  • records worden een per een uit de bestand in de RAL ingelezen tot EOF

speciaal geval is de text file

werken met EOF (end of file) en EOLN (end of line)

=> plaats winst omdat je niet op voorrand de grootte dient aan te duiden (externe geheugen = gegevens worden bewaart)

<p>unlimited data units </p><p>=&gt; bestanden worden bewaard in het extern geheugen, alle andere variabele types in het intern geheugen </p><p>elementen van de file een per een inlezen en stockeren in het intern geheugen </p><ul><li><p>records worden een per een uit de bestand in de RAL ingelezen tot EOF </p></li></ul><p>speciaal geval is de text file </p><p>werken met EOF (end of file) en EOLN (end of line) </p><p>=&gt; plaats winst omdat je niet op voorrand de grootte dient aan te duiden (externe geheugen = gegevens worden bewaart) </p>
15
New cards

primitieven

elementaire, fundamentele gegevenstypen die rechtstreeks worden ondersteund door de programmeertaal zelf. Primitieve gegevenstypen vormen de bouwstenen waarmee complexere gegevensstructuren worden opgebouwd. De exacte set van primitieven kan variëren tussen programmeertalen, maar hier zijn enkele veelvoorkomende voorbeelden:

  • all GPL3 have very similar primitives, sometimes with slightly different syntax

  • these also correspond to the primitives introduced for pseudo-code

in pyhton ;

  • z= x+y


<p><span>elementaire, fundamentele gegevenstypen die rechtstreeks worden ondersteund door de programmeertaal zelf. Primitieve gegevenstypen vormen de bouwstenen waarmee complexere gegevensstructuren worden opgebouwd. De exacte set van primitieven kan variëren tussen programmeertalen, maar hier zijn enkele veelvoorkomende voorbeelden:</span></p><ul><li><p>all GPL3 have very similar primitives, sometimes with slightly different syntax </p></li><li><p>these also correspond to the primitives introduced for pseudo-code</p></li></ul><p>in pyhton ; </p><ul><li><p>z= x+y </p></li><li><p></p></li></ul>
16
New cards

calculation rules in expressions

uitgevoerd van links naar rechts

voorrangsregels : haakjes, functies, macht, */, +-, vergelijkingsoperatoren = > <>

resultaat van vergelijkingsoperatoren is steeds boolean

17
New cards

operatoren en voorrangen bij boolean

knowt flashcard image
18
New cards

primitives : 2.1) controle statement GOTO

knowt flashcard image
19
New cards

primitives : 2.2) controle statement if

knowt flashcard image
20
New cards

primitives : 2.3 ) controle statement while

knowt flashcard image
21
New cards

primitives: 2.5) controle statelent

knowt flashcard image
22
New cards

primitives : 3) comment/ annotations

  • explanation wtitten between instructions

  • very helpful for a person to better understand what a program or piece of code does

  • is ignored by the compiler

  • in python : # this is a comment

23
New cards

primitives : 4) procedures en of functions

in python word alles function genoemd

maar in andere talen w er een onderscheid gemaakt tussen functie en procedure

  • functie : levert een waarde op

  • procedure is een sequentie van acties binnen het hoofdprogramma maar die appart staan

= modules = mini programma’s


def FunctionNAme(part1[par2..])

call in python : FunctionName (arg1 [, arg 2..])

24
New cards

voorgedefiieerd efuncties in python

knowt flashcard image
25
New cards

wat is de nut van een parameter bij procedures en functies

op welke manieren gebeurt dat

= methode om waarden aan een procedure/ functie te geven

  • pass by value : een kopie van de waarde/ variabele wordt doorgegeven, deze lokale kopie w daarna gewist

  • pass by reference : is een referentie naar de waarde/ variabele => zelfde register => veranderingen zijn permanent

<p>= methode om waarden aan een procedure/ functie te geven </p><ul><li><p>pass by value : een kopie van de waarde/ variabele wordt doorgegeven, deze lokale kopie w daarna gewist </p></li><li><p>pass by reference : is een referentie naar de waarde/ variabele =&gt; zelfde register =&gt; veranderingen zijn permanent </p></li></ul>
26
New cards
27
New cards
28
New cards
29
New cards