Informatica 2e semester

Maat: px
Weergave met pagina beginnen:

Download "Informatica 2e semester"

Transcriptie

1 Informatica Les 2 bibliotheekklassen - Leibniz - digitaal Jan Lemeire Informatica 2 e semester februari mei 2018 Informatica 2e semester: HOC 2

2 Vandaag 1. Herhaling object-georienteerd programmeren 2. Oefening 3. Bibliotheekklassen 4. Deel III: hoofdstuk 0 5. Deel III: hoofdstuk 1 6. Goocheltruc 7. Binaire representatie

3 Herhaling

4 Informatica 2e semester: HOC 1 p. 18

5 public class Student extends Persoon { enum Faculteit {IR, WE, GF, LK, LW, ES, RC, PE}; p. 21 int rolnummer; Faculteit faculteit = Faculteit.IR; ArrayList<Vak> vakken; Map<Vak, Integer> punten; float score; Student(String voornaam, String naam, int rolnummer, Faculteit fac){ super(voornaam, naam); this.rolnummer=rolnummer; this.faculteit = fac; vakken = new ArrayList<Vak>(); punten = new HashMap<Vak, Integer>(); } } public class Vak { String naam, titularis; int SP; Vak(String naam, String titularis, int SP){ this.naam = naam; this.titularis = titularis; this.sp = SP; } } Informatica 2e semester: HOC 2

6 publicaanmaken static void main(string[] objecten args) { Student rik = new Student("Rik", "Vermeulen", 37365, Faculteit.IR); Student jana = new Student("Jana", "Laplace", , Faculteit.WE); Vak informatica = new Vak("Informatica", "Jan Lemeire", 7); Vak materiaalkunde = new Vak("Materiaalkunde", "Herman Terryn", 4); Vak mechanica = new Vak("Mechanica", "Dirk Lefeber", 7); rik.vakken.add(informatica); rik.punten.put(informatica, 14); rik.vakken.add(materiaalkunde); rik.punten.put(materiaalkunde, 12); rik.vakken.add(mechanica); rik.punten.put(mechanica, 17); } jana.vakken.add(informatica); jana.punten.put(informatica, 16); jana.vakken.add(mechanica); jana.punten.put(mechanica, 13); Informatica 2e semester: HOC 2

7 Berekening score int berekentotaal(){ score=0; for-lus int totaalsp=0; for(vak vak: vakken){ score += punten.get(vak) * vak.sp; totaalsp += vak.sp; } score /= totaalsp; return score; } float scorerik = rik.berekentotaalscore(); float scorejana = jana.berekentotaalscore(); System.out.println(rik+" behaalde "+scorerik+"/20"); System.out.println(jana+" behaalde "+scorejana+"/20"); Informatica 2e semester: HOC 2 Jan Lemeire Pag. 7 / 75

8 Oefening

9 p. 62

10 p. 23

11 Javabibliotheekklassen

12 p. 25 Scanner stelt je in staat om String te ontleden verwerken gebruikersinvoer en/of tekstbestanden import java.util.scanner; public class ScannerExample { public static void main(string[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Geef een invoer:"); double num = scanner.nextdouble(); System.out.println("De vierkantswortel van " + num + "is: " + Math.sqrt(num)); scanner.close(); Informatica 2e } semester: HOC 2 } Jan Lemeire Pag. 12 / 75

13 Hoe? 1. Maak een object via 1 van de constructors 2. Gebruik methoden op object 3. Eventueel afsluiten Gebruik online documentatie Informatica 2e semester: HOC 2 Jan Lemeire Pag. 13 / 75

14 Constructors Constructor Summary Scanner(InputStream source) Constructs a new Scanner that produces values scanned from the specified input stream. Scanner(Path source) Constructs a new Scanner that produces values scanned from the specified file. Scanner(String source) Constructs a new Scanner that produces values scanned from the specified string. Informatica 2e semester: HOC 2 Jan Lemeire Pag. 14 / 75

15 Method Summary void String String boolean boolean boolean boolean boolean boolean boolean boolean String boolean close() Closes this scanner. Methoden findinline(string pattern) Attempts to find the next occurrence of a pattern constructed from the specified string, ignoring delimiters. findwithinhorizon(pattern pattern, int horizon) Attempts to find the next occurrence of the specified pattern. hasnext() Returns true if this scanner has another token in its input. hasnext(string pattern) Returns true if the next token matches the pattern constructed from the specified string. hasnextboolean() Returns true if the next token in this scanner's input can be interpreted as a boolean value using a case insensitive pattern created from the string "true false". hasnextdouble() Returns true if the next token in this scanner's input can be interpreted as a double value using the nextdouble() method. hasnextfloat() Returns true if the next token in this scanner's input can be interpreted as a float value using the nextfloat() method. hasnextint() Returns true if the next token in this scanner's input can be interpreted as an int value in the default radix using the nextint() method. hasnextline() Returns true if there is another line in the input of this scanner. hasnextlong() Returns true if the next token in this scanner's input can be interpreted as a long value in the default radix using the nextlong() method. next() Finds and returns the next complete token from this scanner. nextboolean() Scans the next token of the input into a boolean value and returns that value. double nextdouble() Informatica 2e semester: Scans the HOC next 2 token of the input as a double. floatjan Lemeire nextfloat() Pag. 15 / 75

16 p Random Pseudowillekeurig getal, want computer is een deterministisch systeem Gebaseerd op een algoritme die een reeks van schijnbaar-total-willekeurige getallen genereert nseed = 5323 # initial starting seed def PRNG(): global nseed # Take the current seed and generate a new value from it nseed = * nseed # Take the seed and return a value between 0 and return nseed % Informatica 2e semester: HOC 2 Jan Lemeire Pag. 16 / 75

17 import java.util.random; Random public class Randomtest { public static void main(string[] args) { // de seed wordt automatisch bepaald (op basis van de huidige tijd) Random rand = new Random(); p for-lus for (int i=0; i<8; i++) System.out.print(rand.nextInt(1000) + ", "); System.out.println(); } } rand = new Random(42); // vaste seed for (int i=0; i<8; i++) System.out.print(rand.nextInt(1000) + ", "); System.out.println(); rand = new Random(42); // vaste seed (dezelfde!) for (int i=0; i<8; i++) System.out.print(rand.nextInt(1000) + ", "); System.out.println(); Uitvoer: 200, 593, 612, 198, 427, 419, 276, 790, 130, Informatica 763, 2e 248, semester: 884, HOC 2 970, 525, 505, 918, Jan Lemeire Pag. 17 / , 763, 248, 884, 970, 525, 505, 918,

18 p. 15 Java s for-lus initialisatie eindconditie increment for(int i=0;i<100;i+=2){ } System.out.print(i+", "); i += 2 i = i + 2 i + + i += 1 i = i + 1 Informatica 2e semester: HOC 2 Jan Lemeire Pag. 18 / 75

19 Constructor Constructor Summary Random() Creates a new random number generator. Random(long seed) Creates a new random number generator using a single long seed. Informatica 2e semester: HOC 2 Jan Lemeire Pag. 19 / 75

20 Method Summary boolean void double float double int int long void Informatica 2e semester: HOC 2 Methoden nextboolean() Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence. nextbytes(byte[] bytes) Generates random bytes and places them into a user-supplied byte array. nextdouble() Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence. nextfloat() Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence. nextgaussian() Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence. nextint() Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence. nextint(int bound) Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. nextlong() Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence. setseed(long seed) Sets the seed of this random number generator using a single long seed. Jan Lemeire Pag. 20 / 75

21 1.2.3 De ArrayList Opslaan van elementen de Python-lijst Informatica 2e semester: HOC 2 Jan Lemeire Pag. 21 / 75

22 p. 14 ArrayList vs Python list Array ArrayList Python list Python tuple Flexibele grootte Flexibele grootte Vaste grootte Initiële grootte facultatief Niet nodig Bij initialisatie Arrays zien we volgende keer ArrayList<Integer> arraylist = new ArrayList<Integer>(); list=[] Creatie en initialisatie samen Initialisatie niet mogelijk list=[1, 2, 3] tuple = (1, 2, 3, 4, 5 ) x = arraylist.get(2); x=list[2] x=tuple[2] arraylist.set(1, 5); list[1]=5 Veranderen niet mogelijk arraylist.add(7); list.append(7) Niet mogelijk arraylist.size() len(list) len(tuple) Jan Lemeire Pag. 22 / 75

23 p. 29 Aanmaken Constructor Summary ArrayList() Constructs an empty list with an initial capacity of ten. ArrayList(int initialcapacity) Constructs an empty list with the specified initial capacity. ArrayList<Integer> array = new ArrayList<Integer>(); Bij het aanmaken specifieer je het type Type is dus in feite een parameter Informatica 2e semester: HOC 2 Jan Lemeire Pag. 23 / 75

24 Java Generics Je maakt een klasse, maar laat het exacte type nog onbepaald Gebruiker geeft het type mee bij constructie Moet wel een klasse zijn Elk primitief type heeft een klassevariant Primitief type int float double char boolean Klasse Integer Float Double Char Boolean Informatica 2e semester: HOC 2 Jan Lemeire Pag. 24 / 75

25 Method Summary boolean add(e e) Appends the specified element to the end of this list. void add(int index, E element) boolean contains(object o) Informatica 2e semester: HOC 2 Inserts the specified element at the specified position in this list. Returns true if this list contains the specified element. E get(int index) Returns the element at the specified position in this list. int indexof(object o) Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. boolean isempty() Returns true if this list contains no elements. E remove(int index) boolean remove(object o) Removes the element at the specified position in this list. Removes the first occurrence of the specified element from this list, if it is present. E set(int index, E element) Replaces the element at the specified position in this list with the specified element. int size() Returns the number of elements in this list.

26 1.2.4 Verzameling Set

27 p. 31 De Set Definitie van documentatie: A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element. Een wiskundige verzameling dus... In Java gedefinieerd als interface Informatica 2e semester: HOC 2 Jan Lemeire Pag. 27 / 75

28 Method Summary boolean add(e e) Adds the specified element to this set if it is not already present. boolean addall(collection<? extends E> c) Adds all of the elements in the specified collection to this set if they're not already present (optional operation). void clear() Removes all of the elements from this set. boolean contains(object o) Returns true if this set contains the specified element. boolean containsall(collection<?> c) Returns true if this set contains all of the elements of the specified collection. boolean equals(object o) Compares the specified object with this set for equality. boolean isempty() Returns true if this set contains no elements. boolean remove(object o) Removes the specified element from this set if it is present (optional operation). boolean removeall(collection<?> c) Removes from this set all of its elements that are contained in the specified collection. boolean retainall(collection<?> c) Retains only the elements in this set that are contained in the specified collection. int size() Informatica 2e semester: HOC 2 Returns the number of elements in this set (its cardinality).

29 Bewerkingen bewerking methode Unie a U b AddAll() Doorsnede a b RetainAll() Verschil a \ b RemoveAll() Symmetrische verschil (a \ b) U (b \ a) Combinatie van bovenstaande Informatica 2e semester: HOC 2 Jan Lemeire Pag. 29 / 75

30 Interfaces

31 Set.java public interface Set<E> extends Collection<E> { } int size(); boolean isempty(); boolean contains(object o); Iterator<E> iterator(); Object[] toarray(); <T> T[] toarray(t[] a); boolean add(e e); boolean remove(object o); boolean containsall(collection<?> c); boolean addall(collection<? extends E> c); boolean retainall(collection<?> c); boolean removeall(collection<?> c); void clear(); boolean equals(object o); int hashcode();

32 Interfaces p. 5 Alle methodes zijn abstract: enkel header, geen implementatie Klasse die interface implementeert moet alle methodes implementeren Filosofie: een interface definieert hoe je met een object communiceert. Je hoeft de implementatie niet te kennen Inwisselbare implementatie, efficiëntste implementatie hangt af van situatie Informatica 2e semester: HOC 2 Jan Lemeire Pag. 32 / 75

33 Pijlers van object-georiënteerde programmeertalen p. 7

34 Set Object: implementatie Implementaties voldoen aan het Setkontrakt Gebruik: TreeSet en HashSet Komen we op terug in hoofdstuk 8 Informatica 2e semester: HOC 2 Jan Lemeire Pag. 34 / 75

35 Leibniz f x Informatica 2e semester: HOC 2 Jan Lemeire Pag. 36 / 75

36 Calculemus! Berechnen wir!

37 Leibniz Droomde van de Calculus ratiocinator Een logisch denkend apparaat Informatica 2e semester: HOC 2 Jan Lemeire Pag. 38 / 75

38 Hoofdstuk 0: Het idee Jan Lemeire Pag. 39 / 75

39 Eerste computer, mechanisch mechanische onderdelen Kostprijs: Charles Babbage Informatica 2e semester: HOC 2 Jan Lemeire Pag. 40 / 75

40 Babbage Difference Engine made with LEGO This machine can evaluate polynomials of the form Ax 2 + Bx + C for x=0, 1, 2, n with 3 digit results. Informatica 2e semester: HOC 2 Jan Lemeire Pag. 41 / 75

41 De eerste computerwetenschapper & visionair Ada Lovelace Poëtische wetenschap. Ziet kracht van Babbage s machine Machine kan ook met symbolen om => mentale processen! Beschrijft wat software en een algoritme is: stap-voor-stap bewerkingen doen om tot de oplossing te komen. Voorziet het inzetten van herbruikbare functies. Schrijft het eerste programma bestemd voor de universele computer van Charles Babbage. Vraagt zich af of "machines ooit zullen kunnen denken?" Ze dacht van niet. Ada ving een glimp van de toekomst... In de 1980s is de programmeertaal Ada ter ere van haar gemaakt Jan Lemeire Pag. 42 / 48

42 Informatica 2e semester: HOC 2 Jan Lemeire Pag. 43 / 75

43 ENIAC Eerste computer: WOII Informatica 2e semester: HOC 2 John Mauchly and John Eckert, 1945 Jan Lemeire Pag. 44 / 48

44 John Atanasoff Clifford Berry Atanasoff-Berry Computer

45 Honeywell v. Sperry Rand case, 1973 Honeywell v. Sperry Rand case, 1973 Jan Lemeire Pag. 46 / 48

46

47 Waarmaken van Leibniz s droom 0 & 9 niet te kennen (9) Artificiële intelligentie (8) Communicatie & internet (7) Operating system (6) Computatietheorie & Software (5) Efficiënt productieproces (4) Hardware architectuur Electronica: (2) Relais -schakeling, (3) Geheugen (1) Digitaal & binair (0) Het idee Informatica deel III: technologie, historiek en economische aspecten

48 Referenties The Innovators: How a Group of Hackers, Geniuses and Geeks Created the Digital Revolution, by Walter Isaacson, Aanwezig in de VUB-bibliotheek. In het Nederlands: De uitvinders, hoe een groep hackers, genieën en nerds de digitale revolutie ontketende. The Universal Computer. The Road from Leibniz to Turing, by Martin Davis, Aanwezig in de VUB-bibliotheek. Links op parallel.vub.ac.be Jan Lemeire Pag. 49 / 75

49 Deel III: parate kennis Deel III parate kennis (gem=1,73) Deel III parate kennis? Jan Lemeire Pag. 50 /

50 Informatica 2e semester: HOC 2 Meest interessante deel van de cursus? Jan Lemeire Pag. 51 / 48

51 Hoofdstuk 1: Van analoog naar digitaal Jan Lemeire Pag. 52 / 75

52 Analoog rekenen Gebruik makend van fysische grootheden Cf Babbage Analoge electronica (bekijken we later) De rekenlat of slide rule was lange tijd hèt rekeninstrument van de ingenieur Informatica 2e semester: HOC 2 Jan Lemeire Pag. 53 / 75

53 Digitale Technologie Informatie wordt geëncodeerd als digits 6:12:08 Analoog Digitaal Informatica 2e semester: HOC 2

54 Muziek Analoog Digitaal informatie gecodeerd door middel van een continu veranderlijke fysische grootheid Informatica 2e semester: HOC 2

55 Muziek Mens hoort tussen 20 en 20,000 Hz informatie gecodeerd door middel van een continu-veranderlijke fysische grootheid Analoog Digitaal (CD) (44100 metingen/s)

56 Analoog Signaal Digitaliseren t (1) Discretizeren: samplen in de tijd t (2) Quantizatie: de amplitude in elk samplepunt voorstellen als een binair getal (3) Alle bits achter elkaar Digitaal signaal Digitaliseren van een analoog signaal (bvb muziek) gebeurt door op geregelde tijdstippen (discretizeren) de amplitude van het signaal weg te schrijven als een aantal bits (quantizeren). Alle bits achter elkaar geven het digitaal signaal. Jan Lemeire Pag. 57 / 75

57 Reconstructie van analoog signaal Gesampled aan 6 KHz aliasing Informatica 2e semester: HOC 2 Jan Lemeire Pag. 58 / 75

58 Digitalisatie van beelden voor elk punt (pixel) de kleur opslaan => bitmap Informatica 2e semester: HOC 2 Jan Lemeire Pag. 59 / 75

59 Effect van signaal-vervormingen of ruis (noise) Analoog signaal Digitaal signaal Informatieverlies Informatie nog te herkennen Jan Lemeire Pag. 60 / 48

60 Waarom digitaal? Unambiguë signalen, immuun voor ruis. Als ruis onder een aanvaardbaar niveau is kan men steeds nog het origineel signaal herkennen. Het is immers een 0 of een 1. Perfecte copieën kunnen gemaakt worden. Bewerkingen zonder informatieverlies Digitale signaalverwerking is mogelijk! Simpel, gemakkelijk te maken. Digitale componenten zijn goedkoop, klein, betrouwbaar en men kan er miljoenen op een klein gebied plaatsen. Alles dat voorgesteld kan worden door één of ander signaal/patroon, kan voorgesteld worden door bits. Jan Lemeire Pag. 61 / 48

61 Go digital! Go binary! Van analoog naar digitaal en binair Leibniz had er al aan gedacht (zoals te zien is in zijn nota s) Ook was dit de basis van de computer van Atanasoff en Berry Informatica 2e semester: HOC 2 Jan Lemeire Pag. 62 / 48

62 Waarom binair? De ultieme essentie van informatie: 0 of 1 (to be or not to be) In digitale toestellen gebruikt men meestal het binaire stelsel omdat binaire cijfers eenvoudig kunnen voorgesteld worden door fysische grootheden zoals een positieve of een negatieve spanning, een magnetisch veld in de ene of de andere richting of een open of gesloten schakelaar. Eenvoudige reconstructie: groter of kleiner dan een drempelwaarde (threshold) bepaalt de bitwaarde Informatica 2e semester: HOC 2 Jan Lemeire Pag. 63 / 48

63 KIES EEN GEHEIM GETAL TUSSEN 1 & 64 6 kaartjes 6 ja/nee vragen Benjamin Jadot, 1 e bachelor industrieel ingenieur, 2016 Jan Lemeire Pag. 64 / 48

64 Jan Lemeire Pag. 65 / 48

65 Jan Lemeire Pag. 66 / 48

66 Jan Lemeire Pag. 67 / 48

67 Jan Lemeire Pag. 68 / 48

68 Jan Lemeire Pag. 69 / 48

69 Jan Lemeire Pag. 70 / 48

70 Binaire representatie Een binair getal (bit) kan voorgesteld worden door 2 voltages die gegeven kunnen worden door een switch: Waarde 0 = 0 Volt = switch open Waarde 1 = 5 Volt = switch gesloten Een getal van n bits kan 2 n waarden aannemen 2 bits : 4 combinaties bits : 8 combinaties bits (= 1 byte) 256 combinaties 16 bits: combinaties 32 bits: combinaties Informatica 2e semester: HOC 2

71 Java basic datatypes Deel java - p. 16 Type Grootte Minimum Maximum Precisie byte 8 bits short 16 bits int 32 bits long 64 bits char 16 bits float 32 bits -3.4x x cijfers double 64 bits -1.7x x cijfers Informatica 2e semester: HOC 2 Jan Lemeire Pag. 72 / 75

72 Hoofdstuk 2: Getallenstelsels en codes Voorstelling van digitale informatie: Binaire getallen Binair talstelsel X 2 X 2 X 2 Gewichten gerelateerd aan positie Te interpreteren binair getal Vermenigvuldig waarde met gewicht Interpretatie van binair getal x x x x Som: = Decimale Interpretatie n a7 a6 a5 a4 a3 a2 a1 a0 a i i 0 Jan Lemeire Pag. 73 / 48 2 i

73 Hoofdstuk 2: Getallenstelsels en codes Voorstelling van digitale informatie: Binaire getallen Enkele oefeningen Decimale Interpretatie Opgave 1: Bereken de decimale interpretatie van de bovenstaande binaire getallen. Opgave 2: Zet om naar binair: 6, 17, 31, 255 Opgave 3: Zet uw geboortedatum om in binair formaat (dag, maand en jaar apart). Opgave 4: Hoeveel decimale getallen kunnen er voorgesteld worden aan de hand van een 10-bit binair woord? Jan Lemeire Pag. 74 / 48

74 Grootte-ordes Bytes 10 3 Kilo kb 2 10 = Mega MB Giga GB Tera TB Peta PB Exa EB 2 60 Vergeet nooit meer: Jan Lemeire Pag. 75 / 48

75 basisoperaties op bits en bytes a b And Or Exclusive or a b a b a= b= ~a Not a & b And a b Or a ^ b Exclusive or a << 3 Shift left a >> 3 Shift right Zie programma BitwiseOperators in package voorbeelden Jan Lemeire Pag. 76 / 48

76 Programma van vorige public class BitwiseOperators { public static void main(string[] args) { int a = 60;/* 60 = */ int b = 13;/* 13 = */ int c = 0; } } c = a & b; /* 12 = and */ System.out.println("a & b = " + c ); c = a b; /* 61 = or */ System.out.println("a b = " + c ); c = a ^ b; /* 49 = exclusive or (xor) */ System.out.println("a ^ b = " + c ); c = ~a; /*-61 = not */ System.out.println("~a = " + c ); c = a << 2; /* 240 = shift left */ System.out.println("a << 2 = " + c ); c = a >> 2; /* 15 = 1111 shift right */ System.out.println("a >> 2 = " + c ); Jan Lemeire Pag. 77 / 48

77 Gegeven: integers x & i int x = 85, i = 4; Enkele toepassingen 1. Is de (i+1)-de bit van x gelijk aan 1? int y = 1 << i; // y wordt een masker genoemd if ((x & y) > 0) else System.out.println("De "+(i+1)+"de bit van +x+" is 1."); System.out.println("De "+(i+1)+"de bit van + x +" is 0."); 2. Zet de (i+1)-de bit van x op 1 i = 1; Beide lijnen verbeterd y = 1 << i; // een masker met een 1 op plaats i x = y; // is identiek aan x = x y; System.out.println("x = "+x+": "+(i+1)+ "de bit is nu 1."); 3. Wat zijn de waarden van de 4 e tot en met de 6 e bit? Zie programma BitwiseOperators in package voorbeelden int z = (x >> 4) & 7; // 7 is hier ook een masker: 111 System.out.println("Bits 4 tot en met 6 van +Integer.toBinaryString(x)+" zijn "+Integer.toBinaryString(z)); Jan Lemeire Pag. 78 / 48

78 Hoofdstuk 2: Getallenstelsels en codes Voorstelling van digitale informatie: Binaire getallen Hexadecimaal talstelsel Om de notatie van binaire getallen te verkorten worden ook de hexadecimale notatie gebruikt. Een hexadecimaal cijfer beschrijft 4 bits en wordt voorgesteld door 0, 1,..., 9, A,..., E. Binair Hex Binair Hex A 1011 B 1100 C 1101 D 1110 E 1111 F Tabel staat niet in cursus Vb: omzetting van D Om aan te duiden dat een getal in het hexadecimaal talstelsel is (bvb tijdens programmeren), voegen we de prefix 0x toe: 0x38D. 0x11 is dus gelijk aan 17 Jan Lemeire Pag. 79 / 48

79 Voorstelling van karakters De huidige computers gebruiken gestandaardiseerde tabellen waarin de alfanumerieke tekens die op het toetsenbord staan geassocieerd worden met binaire getallen. De meestgebruikte is de ASCII tabel. De 128 tekens van hiernaast kunnen voorgesteld worden met 7 bits (2 7 =128) Informatica 2e semester: HOC 2 Jan Lemeire Pag. 80 / 75

Muziek. Muziek. Analoog rekenen. Hoofdstuk 1: Van analoog naar digitaal. Analoog. Digitaal. Analoog. Gebruik makend van fysische grootheden Cf Babbage

Muziek. Muziek. Analoog rekenen. Hoofdstuk 1: Van analoog naar digitaal. Analoog. Digitaal. Analoog. Gebruik makend van fysische grootheden Cf Babbage Analoog rekenen Gebruik makend van fysische grootheden Cf Babbage Analoge electronica http://www.chem.uoa.gr/applets/appletopamps/appl_opamps2.html Hoofdstuk : Van analoog naar digitaal De rekenlat of

Nadere informatie

Informatica. Deel II: les 2. Leibniz - erven - digitaal. Jan Lemeire Informatica deel II februari mei Parallel Systems: Introduction

Informatica. Deel II: les 2. Leibniz - erven - digitaal. Jan Lemeire Informatica deel II februari mei Parallel Systems: Introduction Informatica Deel II: les 2 Leibniz - erven - digitaal Jan Lemeire Informatica deel II februari mei 2013 Parallel Systems: Introduction Leibniz 1646 1716 Jan Lemeire Pag. 2 / 48 Calculemus! Berechnen wir!

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica Les 2 bibliotheekklassen - Leibniz - digitaal Jan Lemeire Informatica 2 e semester februari mei 2019 Informatica 2e semester: HOC 2 Vandaag 1. Object-georiënteerd programmeren 2. Oefening 3.

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica Les 2 bibliotheekklassen - Leibniz - digitaal Jan Lemeire Informatica 2 e semester februari mei 2017 Informatica 2e semester: HOC 2 Vandaag 1. Herhaling object-georienteerd programmeren 2.

Nadere informatie

Informatica. Les 2. Leibniz -bibliotheekklassen digitaal. Jan Lemeire Informatica 2e semester februari mei Parallel Systems: Introduction

Informatica. Les 2. Leibniz -bibliotheekklassen digitaal. Jan Lemeire Informatica 2e semester februari mei Parallel Systems: Introduction Informatica Les 2 Leibniz -bibliotheekklassen digitaal Jan Lemeire Informatica 2e semester februari mei 2016 Parallel Systems: Introduction Leibniz f x 1646 1716 Jan Lemeire Pag. 2 / 53 Calculemus! Berechnen

Nadere informatie

Informatica. Deel II&III: les 2. Leibniz - erven - digitaal. Jan Lemeire Informatica deel II&III februari mei Parallel Systems: Introduction

Informatica. Deel II&III: les 2. Leibniz - erven - digitaal. Jan Lemeire Informatica deel II&III februari mei Parallel Systems: Introduction Informatica Deel II&III: les 2 Leibniz - erven - digitaal Jan Lemeire Informatica deel II&III februari mei 2015 Parallel Systems: Introduction Leibniz 1646 1716 Informatica II: les 2 Jan Lemeire Pag. 2

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica Les 3 Elektronica Interfaces - Overschrijven Jan Lemeire Informatica 2 e semester februari mei 2018 Informatica 2e semester: HOC 3 Vandaag 1. Deel III: hoofdstuk 1 binair rekenen 2. Deel III:

Nadere informatie

Informatica. Deel II&III: les 1. Java versus Python. Jan Lemeire Informatica deel II&III februari mei Parallel Systems: Introduction

Informatica. Deel II&III: les 1. Java versus Python. Jan Lemeire Informatica deel II&III februari mei Parallel Systems: Introduction Informatica Deel II&III: les 1 Java versus Python Jan Lemeire Informatica deel II&III februari mei 2016 Parallel Systems: Introduction identificeren van cellen Arabidopsis (zandraket) Arabidopsis (zandraket)

Nadere informatie

Informatica. les 1. Java versus Python. Jan Lemeire Informatica 2 e semester februari mei Parallel Systems: Introduction

Informatica. les 1. Java versus Python. Jan Lemeire Informatica 2 e semester februari mei Parallel Systems: Introduction Informatica les 1 Java versus Python Jan Lemeire Informatica 2 e semester februari mei 2017 Parallel Systems: Introduction Parallel Systems: Introduction Parallel Systems: Introduction September 14, 2015

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica les 1 Java versus Python Jan Lemeire Informatica 2 e semester februari mei 2018 September 14, 2015 Superpositie van signalen In faze In tegenfaze UPDATE: August 14, 2017 Detection of a gravitional

Nadere informatie

Informatica. Deel II: les 3. Electronica Arrays. Jan Lemeire Informatica deel II februari mei Parallel Systems: Introduction

Informatica. Deel II: les 3. Electronica Arrays. Jan Lemeire Informatica deel II februari mei Parallel Systems: Introduction Informatica Deel II: les 3 Electronica Arrays Jan Lemeire Informatica deel II februari mei 2014 Parallel Systems: Introduction Leibniz droom De Calculus ratiocinator Een logisch denkend apparaat 1646 1716

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica les 1 Java versus Python Jan Lemeire Informatica 2 e semester februari mei 2019 September 14, 2015 Superpositie van signalen In faze In tegenfaze UPDATE: August 14, 2017 Detection of a gravitional

Nadere informatie

Informatica. Deel II: les 5. productieproces & stacks/queues/linked lists. Jan Lemeire Informatica deel II februari mei 2014

Informatica. Deel II: les 5. productieproces & stacks/queues/linked lists. Jan Lemeire Informatica deel II februari mei 2014 Informatica Deel II: les 5 productieproces & stacks/queues/linked lists Jan Lemeire Informatica deel II februari mei 2014 Parallel Systems: Introduction Hoofdstuk 6: Het productieproces Jan Lemeire Pag.

Nadere informatie

Informatica. Deel II: les 1. Java versus Python. Jan Lemeire Informatica deel II februari mei 2015. Parallel Systems: Introduction

Informatica. Deel II: les 1. Java versus Python. Jan Lemeire Informatica deel II februari mei 2015. Parallel Systems: Introduction Informatica Deel II: les 1 Java versus Python Jan Lemeire Informatica deel II februari mei 2015 Parallel Systems: Introduction Arabidopsis (zandraket) Arabidopsis (zandraket) MMIQQA Multimodal Microscopic

Nadere informatie

Lessen Java: Reeks pag. 1

Lessen Java: Reeks pag. 1 Lessen Java: Reeks 2 1-3-2016 pag. 1 Primitieve types type grootte waardes byte 8 bits 128, 127 short 16 bits 32768, 32767 int 32 bits 2 31, 2 31 1 long 64 bits 2 63, 2 63 1 type grootte waardes float

Nadere informatie

Informatica. Deel II&III: les 4. geheugen set, stacks & queues - interfaces. Jan Lemeire Informatica deel II&III februari mei 2015

Informatica. Deel II&III: les 4. geheugen set, stacks & queues - interfaces. Jan Lemeire Informatica deel II&III februari mei 2015 Informatica Deel II&III: les 4 geheugen set, stacks & queues - interfaces Jan Lemeire Informatica deel II&III februari mei 2015 Parallel Systems: Introduction Waarmaken van Leibniz s droom (9) Artificiële

Nadere informatie

Informatica. Deel II: les 3. Electronica Arrays. Jan Lemeire Informatica deel II februari mei 2015. Parallel Systems: Introduction

Informatica. Deel II: les 3. Electronica Arrays. Jan Lemeire Informatica deel II februari mei 2015. Parallel Systems: Introduction Informatica Deel II: les 3 Electronica Arrays Jan Lemeire Informatica deel II februari mei 2015 Parallel Systems: Introduction Leibniz droom De Calculus ratiocinator Een logisch denkend apparaat 1646 1716

Nadere informatie

Waarmaken van Leibniz s droom

Waarmaken van Leibniz s droom Waarmaken van Leibniz s droom Artificiële intelligentie Communicatie & internet Operating system Economie Computatietheorie & Software Efficiënt productieproces Hardware architectuur Electronica: relais

Nadere informatie

Vakgroep CW KAHO Sint-Lieven

Vakgroep CW KAHO Sint-Lieven Vakgroep CW KAHO Sint-Lieven Objecten Programmeren voor de Sport: Een inleiding tot JAVA objecten Wetenschapsweek 20 November 2012 Tony Wauters en Tim Vermeulen tony.wauters@kahosl.be en tim.vermeulen@kahosl.be

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica Les 4 arrays encapsulatie - geheugen Jan Lemeire Informatica 2 e semester februari mei 2017 Vandaag 1. Arrays 2. Oefening 3. Algoritmes met arrays 4. Encapsulatie 5. Klasse-oefening 6. Deel

Nadere informatie

Zelftest Programmeren in Java

Zelftest Programmeren in Java Zelftest Programmeren in Java Document: n0883test.fm 22/01/2013 ABIS Training & Consulting P.O. Box 220 B-3000 Leuven Belgium TRAINING & CONSULTING INLEIDING BIJ DE ZELFTEST PROGRAMMEREN IN JAVA Deze test

Nadere informatie

Waarmaken van Leibniz s droom

Waarmaken van Leibniz s droom Waarmaken van Leibniz s droom Artificiële intelligentie Communicatie & internet Operating system Economie Computatietheorie & Software Efficiënt productieproces Hardware architectuur Electronica: relais

Nadere informatie

Modelleren en Programmeren

Modelleren en Programmeren Modelleren en Programmeren Jeroen Bransen 11 december 2015 Ingebouwde datastructuren Meer boomstructuren Access specifiers Gebruikersinvoer Codestijl Packages SAT-solver Ingebouwde datastructuren Ingebouwde

Nadere informatie

Modelleren en Programmeren

Modelleren en Programmeren Modelleren en Programmeren Jeroen Bransen 6 december 2013 Terugblik Programma en geheugen Opdrachten Variabelen Methoden Objecten Klasse Programma en geheugen Opdrachten Variabelen zijn gegroepeerd in

Nadere informatie

public boolean equaldates() post: returns true iff there if the list contains at least two BirthDay objects with the same daynumber

public boolean equaldates() post: returns true iff there if the list contains at least two BirthDay objects with the same daynumber Tentamen TI1310 Datastructuren en Algoritmen, 15 april 2011, 9.00-12.00 TU Delft, Faculteit EWI, Basiseenheid Software Engineering Bij het tentamen mag alleen de boeken van Goodrich en Tamassia worden

Nadere informatie

Objectgericht programmeren 1.

Objectgericht programmeren 1. Objectgericht programmeren 1 joost.vennekens@kuleuven.be http://www.cs.kuleuven.be/~joost/dn Objectgericht ontwerpen 35% Objectgericht ontwerpen 65% OP1 Informatiesystemen 50% Databanken 50% OP1 Evaluatie

Nadere informatie

Java. Basissyllabus. Egon Pas

Java. Basissyllabus. Egon Pas Java Basissyllabus Egon Pas 2011 BeanPole bvba Gasmeterlaan 92-9000 Gent BTW BE 472.902.516 Tel: + 32 9 224 42 17 Fax: + 32 9 223 62 88 www.beanpole.be info@beanpole.be 1 Programmeren 1.1 Hoe werkt een

Nadere informatie

Informatica. Deel II: les 1. Java versus Python. Jan Lemeire Informatica deel II februari mei 2014. Parallel Systems: Introduction

Informatica. Deel II: les 1. Java versus Python. Jan Lemeire Informatica deel II februari mei 2014. Parallel Systems: Introduction Informatica Deel II: les 1 Java versus Python Jan Lemeire Informatica deel II februari mei 2014 Parallel Systems: Introduction Arabidopsis (zandraket) Arabidopsis (zandraket) MMIQQA Multimodal Microscopic

Nadere informatie

Modelleren en Programmeren

Modelleren en Programmeren Modelleren en Programmeren Jeroen Bransen 9 december 2015 Foreach String arrays Boomstructuren Interfaces Ingebouwde datastructuren Quiz Foreach Foreach Speciale versie van for om iets voor alle elementen

Nadere informatie

Voorbeeldtentamen Inleiding programmeren (IN1608WI), Oktober 2003, , Technische Universiteit Delft, Faculteit EWI, Afdeling 2.

Voorbeeldtentamen Inleiding programmeren (IN1608WI), Oktober 2003, , Technische Universiteit Delft, Faculteit EWI, Afdeling 2. Voorbeeldtentamen Inleiding programmeren (IN1608WI), Oktober 2003, 14.00-15.30, Technische Universiteit Delft, Faculteit EWI, Afdeling 2. Dit tentamen bestaat uit twee delen. Deel 1 (14.00-14.45, gesloten

Nadere informatie

Ingebouwde klassen & methodes

Ingebouwde klassen & methodes Ingebouwde klassen & methodes Statische methodes Methodes die bij een klasse horen ipv. bij een object public class Docent { public static Docent departementshoofd() { return new Docent("Jan Ivens"); private

Nadere informatie

Programmeren in Java les 3

Programmeren in Java les 3 4 september 2015 Deze les korte herhaling vorige week loops methodes Variabelen Soorten variabelen in Java: integer: een geheel getal, bijv. 1,2,3,4 float: een gebroken getal, bijv. 3.1415 double: een

Nadere informatie

http://www.liacs.nl/home/kosters/java/

http://www.liacs.nl/home/kosters/java/ sheets Programmeren 1 Java college 2, Walter Kosters De sheets zijn gebaseerd op de hoofdstukken 2 tot en met 6 van: D. Bell en M. Parr, Java voor studenten, Prentice Hall, 2002 http://www.liacs.nl/home/kosters/java/

Nadere informatie

Kwis (3) class X { public void a() { System.out.println("x"); public static void main(string[] args) { X x = new X();

Kwis (3) class X { public void a() { System.out.println(x); public static void main(string[] args) { X x = new X(); Kwis (3) class X { public void a() { System.out.println("x"); class Y extends X { public void a() { System.out.println("y"); class Z extends Y { public void a() { System.out.println("z"); public static

Nadere informatie

Les A-03 Binaire en hexadecimale getallen

Les A-03 Binaire en hexadecimale getallen Les A-03 Binaire en hexadecimale getallen In deze les wordt behandeld hoe getallen kunnen worden voorgesteld door informatie die bestaat uit reeksen 0-en en 1-en. We noemen deze informatie digitale informatie.

Nadere informatie

Elementary Data Structures 3

Elementary Data Structures 3 Elementary Data Structures 3 Ferd van Odenhoven Fontys Hogeschool voor Techniek en Logistiek Venlo Software Engineering 29 september 2014 ODE/FHTBM Elementary Data Structures 3 29 september 2014 1/14 Meer

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica 2 e semester: les 5 computerarchitectuur chips lineaire datastructuren Jan Lemeire Informatica 2 e semester februari mei 2019 Vandaag 1. Array-algoritmen vervolg (hfst 2) 2. Stapel (hfst 3)

Nadere informatie

Universiteit van Amsterdam FNWI. Voorbeeld van tussentoets Inleiding programmeren

Universiteit van Amsterdam FNWI. Voorbeeld van tussentoets Inleiding programmeren Universiteit van Amsterdam FNWI Voorbeeld van tussentoets Inleiding programmeren Opgave 1: Wat is de uitvoer van dit programma? public class Opgave { static int i = 0 ; static int j = 1 ; int i = 1 ; int

Nadere informatie

IMP Uitwerking week 13

IMP Uitwerking week 13 IMP Uitwerking week 13 Opgave 1 Nee. Anders moet bijvoorbeeld een venster applicatie een subklasse zijn van zowel Frame en WindowListener. Als de applicatie ook een button of een menu heeft, dan moet het

Nadere informatie

Modelleren en Programmeren

Modelleren en Programmeren Modelleren en Programmeren Jeroen Bransen 13 december 2013 Terugblik Fibonacci public class Fibonacci { public static void main(string[] args) { // Print het vijfde Fibonaccigetal System.out.println(fib(5));

Nadere informatie

Informatica 2e semester

Informatica 2e semester Informatica Les 3 Elektronica Overschrijven - GUI Jan Lemeire Informatica 2 e semester februari mei 2017 Informatica 2e semester: HOC 3 Vandaag 1. Bibliotheekklassen Set & Map 2. Interfaces 3. Oefening

Nadere informatie

Een topprogrammeur in het OO programmeren is Graig Larman. Hij bedacht de volgende zin:

Een topprogrammeur in het OO programmeren is Graig Larman. Hij bedacht de volgende zin: Java Les 2 Theorie Beslissingen Algemeen Net als in het dagelijks leven worden in software programma s beslissingen genomen, naast het toekennen van waarden aan variabelen zijn beslissingen één van de

Nadere informatie

Hoofdstuk 0. Van Python tot Java.

Hoofdstuk 0. Van Python tot Java. Hoofdstuk 0. Van Python tot Java. In dit eerste hoofdstuk maken we de overstap van Python naar Java. We bespreken de verschillen en geven wat achtergrondinformatie. In het volgende hoofdstuk gaan we dieper

Nadere informatie

Java spiekbrief. Commentaar. Definitie van een methode. Types. Variabelendeclaratie. Definitie van een klasse. Namen. Definitie van een veld

Java spiekbrief. Commentaar. Definitie van een methode. Types. Variabelendeclaratie. Definitie van een klasse. Namen. Definitie van een veld Java spiekbrief Commentaar Dient enkel voor de menselijke lezer. // tot het einde van de lijn /* Dit type commentaar kan gerust meerdere lijnen beslaan. */ /** En deze speciale vorm wordt gebruikt voor

Nadere informatie

ALGORITMIEK: answers exercise class 7

ALGORITMIEK: answers exercise class 7 Problem 1. See slides 2 4 of lecture 8. Problem 2. See slides 4 6 of lecture 8. ALGORITMIEK: answers exercise class 7 Problem 5. a. Als we twee negatieve (< 0) getallen bij elkaar optellen is het antwoord

Nadere informatie

Oefeningen Java Oplossingen

Oefeningen Java Oplossingen Oefeningen Java en Opgave 1 Is de uitvoer van het volgende code-fragment (a), (b) of (c)? System.out.print("A"); System.out.println("B"); System.out.print("C\n"); System.out.print("D" + "E"); System.out.print("F");

Nadere informatie

Python (gem=1,86) Java (gem=1,57) Enquete cursus informatica 1e bachelors oefeningen beter aansluiten bij project?

Python (gem=1,86) Java (gem=1,57) Enquete cursus informatica 1e bachelors oefeningen beter aansluiten bij project? Enquete cursus informatica 1e bachelors 216-217 Python (gem=1,86) Java (gem=1,7) 3 3 2 2 1 1 3 2 1-1 -2-3 3 2 1-1 -2-3 2 Combinatie python va (gem=1,6) 1 Hoe is de overgang python2va 1 1 3 2 1-1 -2-3 3

Nadere informatie

public boolean egualdates() post: returns true i f f there i f the l i s t contains at least two BirthDay objects with the same daynumber

public boolean egualdates() post: returns true i f f there i f the l i s t contains at least two BirthDay objects with the same daynumber Tentamen TI1310 Datastructuren en Algoritmen, 15 april 2011, 9.00-12.00 TU Delft, Faculteit EWI, Basiseenheid Software Engineering Bij het tentamen mag alleen de boeken van Goodrich en Tamassia worden

Nadere informatie

slides12.pdf December 14, 2001 1

slides12.pdf December 14, 2001 1 Onderwerpen Inleiding Algemeen 12 Getallen Getallen Representaties Rekenen Problemen Piet van Oostrum 12 dec 2001 INL/Alg-12 1 X INL/Alg-12 1 X Getallen Soorten getallen Wat is een getal? Experiment: met

Nadere informatie

Syntax- (compile), runtime- en logische fouten Binaire operatoren

Syntax- (compile), runtime- en logische fouten Binaire operatoren Inhoud Syntax- (compile), runtime- en logische fouten Binaire operatoren Operaties op numerieke datatypen Evaluatie van expressies, bindingssterkte Assignment operaties en short-cut operatoren Controle

Nadere informatie

Uitwerking Aanvullend tentamen Imperatief programmeren Woensdag 24 december 2014, 13.30 15.30 uur

Uitwerking Aanvullend tentamen Imperatief programmeren Woensdag 24 december 2014, 13.30 15.30 uur Uitwerking Aanvullend tentamen Imperatief programmeren Woensdag 24 december 2014, 13.30 15.30 uur 1. deze opgave telt voor 30% van het totaal. Schrijf een compleet programma, dat door de gebruiker vanaf

Nadere informatie

4,7. Praktische-opdracht door een scholier 1959 woorden 1 juni keer beoordeeld

4,7. Praktische-opdracht door een scholier 1959 woorden 1 juni keer beoordeeld Praktische-opdracht door een scholier 1959 woorden 1 juni 2001 4,7 331 keer beoordeeld Vak Wiskunde Tientallig stelsel In een tientallig stelsel heb je de getallen 0 t/m 9 tot je beschikking. Zoals je

Nadere informatie

6,1. Samenvatting door een scholier 1809 woorden 28 oktober keer beoordeeld. Informatica

6,1. Samenvatting door een scholier 1809 woorden 28 oktober keer beoordeeld. Informatica Samenvatting door een scholier 1809 woorden 28 oktober 2005 6,1 16 keer beoordeeld Vak Methode Informatica Turing informatica samenvatting. hst3: algoritme:een beschrijving van stappen die gedaan moeten

Nadere informatie

voegtoe: eerst methode bevat gebruiken, alleen toevoegen als bevat() false is

voegtoe: eerst methode bevat gebruiken, alleen toevoegen als bevat() false is PROEF-Tentamen Inleiding programmeren (IN1608WI), X januari 2010, 9.00-11.00, Technische Universiteit Delft, Faculteit EWI, Afdeling 2. Open boek tentamen: bij het tentamen mag alleen gebruik worden gemaakt

Nadere informatie

Tentamen in2705 Software Engineering

Tentamen in2705 Software Engineering Tentamen in2705 Software Engineering Voorbeeld (bijna tweemaal te groot) U mag meenemen naar dit tentamen: Lethbridge, afdrukken PPT slides, afdrukken handouts. 1. De TU wil een nieuw systeem ontwikkelen

Nadere informatie

Genetische algoritmen in Java met JGAP

Genetische algoritmen in Java met JGAP Genetische algoritmen in Java met JGAP Inleiding JGAP, uitgesproken als "jee-gep", is een framework voor het implementeren van genetische algoritmen en het gebruik ervan in Java. Genetische algoritmen

Nadere informatie

Modelleren en Programmeren

Modelleren en Programmeren Modelleren en Programmeren Jeroen Bransen 25 november 2015 Herhaling Meer herhaling Recursie Mutuele recursie Objecten Herhaling Fibonacci class Fibonacci { public static void fibonaccitot(int bovengrens)

Nadere informatie

Modelleren en Programmeren

Modelleren en Programmeren Modelleren en Programmeren Jeroen Bransen 27 november 2015 Recursie Objecten Constructors Aanpassen variabelen this keyword Recursie Recursie Recursieve functie roept zichzelf (direct of indirect) aan

Nadere informatie

Datatypes Een datatype is de sort van van een waarde van een variabele, veel gebruikte datatypes zijn: String, int, Bool, char en double.

Datatypes Een datatype is de sort van van een waarde van een variabele, veel gebruikte datatypes zijn: String, int, Bool, char en double. Algemeen C# Variabele Een variabele is een willekeurige waarde die word opgeslagen. Een variabele heeft altijd een datetype ( De soort waarde die een variabele bevat). Datatypes Een datatype is de sort

Nadere informatie

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010 FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE Toets Inleiding Kansrekening 1 8 februari 2010 Voeg aan het antwoord van een opgave altijd het bewijs, de berekening of de argumentatie toe. Als je een onderdeel

Nadere informatie

Zelftest Inleiding Programmeren

Zelftest Inleiding Programmeren Zelftest Inleiding Programmeren Document: n0824test.fm 22/01/2013 ABIS Training & Consulting P.O. Box 220 B-3000 Leuven Belgium TRAINING & CONSULTING INLEIDING BIJ DE ZELFTEST INLEIDING PROGRAMMEREN Deze

Nadere informatie

Talstelsels en getalnotaties (oplmodel)

Talstelsels en getalnotaties (oplmodel) Talstelsels en getalnotaties (oplmodel) herhalingsvragen 1. Waarom werken computers binair? Omdat binaire computers veel makkelijker te maken is. De kans op fouten is ook veel kleiner. het spanningsverschil

Nadere informatie

Bouwstenen voor PSE. Datatypes en Datastructuren

Bouwstenen voor PSE. Datatypes en Datastructuren Bouwstenen voor PSE Datatypes en Datastructuren Definitie Datatype Klasse van dataobjecten tesamen met operaties om ze te construeren, te manipuleren en te verwijderen. Een datatype omvat een specificatie

Nadere informatie

NAAM: Programmeren 1 Examen 29/08/2012

NAAM: Programmeren 1 Examen 29/08/2012 Programmeren 29 augustus 202 Prof. T. Schrijvers Instructies Schrijf al je antwoorden op deze vragenbladen (op de plaats die daarvoor is voorzien). Geef ook je kladbladen af. Bij heel wat vragen moet je

Nadere informatie

APPLICATIEBOUW 3E COLLEGE: OBJECT GEORIËNTEERD PROGRAMMEREN, METHODEN, PARAMETERS, SCOPE VAN VARIABELEN. Onderdeel van SmartProducts

APPLICATIEBOUW 3E COLLEGE: OBJECT GEORIËNTEERD PROGRAMMEREN, METHODEN, PARAMETERS, SCOPE VAN VARIABELEN. Onderdeel van SmartProducts APPLICATIEBOUW 3E COLLEGE: OBJECT GEORIËNTEERD PROGRAMMEREN, METHODEN, PARAMETERS, SCOPE VAN VARIABELEN Onderdeel van SmartProducts INHOUD COLLEGE 3 Scope van variabelen {3.9} Class ontwerpen en maken,

Nadere informatie

Waarmaken van Leibniz s droom

Waarmaken van Leibniz s droom Waarmaken van Leibniz s droom Artificiële intelligentie Communicatie & internet Operating system Economie Computatietheorie & Software Efficiënt productieproces Hardware architectuur Electronica: relais

Nadere informatie

6,4. Werkstuk door een scholier 1810 woorden 11 maart keer beoordeeld

6,4. Werkstuk door een scholier 1810 woorden 11 maart keer beoordeeld Werkstuk door een scholier 1810 woorden 11 maart 2002 6,4 349 keer beoordeeld Vak Techniek Computer De computer bestaat al 360 jaar. Dat is iets wat de meeste mensen niet verwachten, want ze denken dat

Nadere informatie

Tentamen Objectgeorienteerd Programmeren TI februari Afdeling ST Faculteit EWI TU Delft

Tentamen Objectgeorienteerd Programmeren TI februari Afdeling ST Faculteit EWI TU Delft I ' Tentamen Objectgeorienteerd Programmeren TI 1200 1 februari 2012 9.00-12.00 Afdeling ST Faculteit EWI TU Delft Bij dit tentamen mag je geen gebruik maken van hulpmiddelen zoals boek of slides. Dit

Nadere informatie

Java spiekbrief. Commentaar. Definitie van een methode. Types. Variabelendeclaratie. Definitie van een klasse. Namen. Definitie van een veld

Java spiekbrief. Commentaar. Definitie van een methode. Types. Variabelendeclaratie. Definitie van een klasse. Namen. Definitie van een veld Java spiekbrief Commentaar Dient enkel voor de menselijke lezer. // tot het einde van de lijn /* Dit type commentaar kan gerust meerdere lijnen beslaan. */ /** En deze speciale vorm wordt gebruikt voor

Nadere informatie

Java Programma structuur

Java Programma structuur Java Programma structuur public class Bla // div. statements public static void main(string argv[]) // meer spul Voortgezet Prog. voor KI, week 4:11 november 2002 1 Lijsten Voorbeelden 2, 3, 5, 7, 13 Jan,

Nadere informatie

Tentamen Objectgeorienteerd Programmeren IN1205 Voorbeeld

Tentamen Objectgeorienteerd Programmeren IN1205 Voorbeeld Tentamen Objectgeorienteerd Programmeren IN1205 Voorbeeld Afdeling ST Faculteit EWI TU Delft Bij dit tentamen mag u gebruik maken van: Barnes, Object-Oriented Programming with Java en de Notitie Algoritmiek

Nadere informatie

Stacks and queues. Introductie 45. Leerkern 45. Terugkoppeling 49. Uitwerking van de opgaven 49

Stacks and queues. Introductie 45. Leerkern 45. Terugkoppeling 49. Uitwerking van de opgaven 49 Stacks and queues Introductie 45 Leerkern 45 6.1 Stacks 45 6.2 Queues 47 6.3 Double-ended queues 48 Terugkoppeling 49 Uitwerking van de opgaven 49 Bijlage: Diagrammen belangrijkste interfaces en klassen

Nadere informatie

Inleiding Programmeren 2

Inleiding Programmeren 2 Inleiding Programmeren 2 Gertjan van Noord November 26, 2018 Stof week 3 nogmaals Zelle hoofdstuk 8 en recursie Brookshear hoofdstuk 5: Algoritmes Datastructuren: tuples Een geheel andere manier om te

Nadere informatie

TENTAMEN Programmeren 1 VOORBEELDUITWERKING

TENTAMEN Programmeren 1 VOORBEELDUITWERKING TENTAMEN Programmeren 1 vakcode: 213500 datum: 10 juli 2004 tijd: 9:00-12:30 uur VOORBEELDUITWERKING Algemeen Bij dit tentamen mag gebruik worden gemaakt van het boek van Niño/Hosch, en van de handleiding

Nadere informatie

INFORMATICA 1STE BACHELOR IN DE INGENIEURSWETENSCAPPEN

INFORMATICA 1STE BACHELOR IN DE INGENIEURSWETENSCAPPEN INFORMATICA 1STE BACHELOR IN DE INGENIEURSWETENSCAPPEN voorbeeldexamen NAAM :... OPMERKINGEN VOORAF Je krijgt 3 uur de tijd om de opdrachten voor dit examen uit te voeren. Verder werken aan je oplossing

Nadere informatie

Java Les 3 Theorie Herhaal structuren

Java Les 3 Theorie Herhaal structuren Java Les 3 Theorie Herhaal structuren Algemeen Een herhaal structuur een is programmeertechniek waarbij bepaalde Java instructies worden herhaald net zo lang tot een bepaalde voorwaarde is bereikt. Een

Nadere informatie

Beginselen van programmeren Practicum 1 (Doolhof) : Oplossing

Beginselen van programmeren Practicum 1 (Doolhof) : Oplossing Beginselen van programmeren Practicum 1 (Doolhof) : Oplossing Introductie In dit document geven we een mogelijke oplossing voor het eerste practicum. Deze oplossing gebruikt verschillende klassen en overerving,

Nadere informatie

NSPYRE LEGO MINDSTORMS UITDAGING (JAVA) INLEIDING. DOEL: SIMULATOR:

NSPYRE LEGO MINDSTORMS UITDAGING (JAVA) INLEIDING. DOEL: SIMULATOR: NSPYRE LEGO MINDSTORMS UITDAGING (JAVA) INLEIDING. Door mee te doen aan deze uitdaging kan je Nspyre laten zien wat je kan. Schrijf jij de beste oplossing dan is deze lego mindstorms nxt 2.0 set voor jou.

Nadere informatie

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE Tentamen Bewijzen en Technieken 1 7 januari 211, duur 3 uur. Voeg aan het antwoord van een opgave altijd het bewijs, de berekening of de argumentatie toe.

Nadere informatie

Tentamen Object Georiënteerd Programmeren TI1206 29 oktober 2014, 9.00-11.00 Afdeling SCT, Faculteit EWI, TU Delft

Tentamen Object Georiënteerd Programmeren TI1206 29 oktober 2014, 9.00-11.00 Afdeling SCT, Faculteit EWI, TU Delft Tentamen Object Georiënteerd Programmeren TI1206 29 oktober 2014, 9.00-11.00 Afdeling SCT, Faculteit EWI, TU Delft Bij dit tentamen mag je geen gebruik maken van hulpmiddelen zoals boek of slides. Digitale

Nadere informatie

Tentamen Objectgeorienteerd Programmeren

Tentamen Objectgeorienteerd Programmeren Tentamen Objectgeorienteerd Programmeren 5082IMOP6Y maandag 16 november 2015 13:00 15:00 Schrijf je naam en studentnummer op de regel hieronder. Sla deze pagina niet om tot de surveillant vertelt dat het

Nadere informatie

SQL datadefinitietaal

SQL datadefinitietaal SQL datadefinitietaal We kunnen er het schema van de database mee bepalen: metadata toevoegen, wijzigen en verwijderen uit een database. Basiscommando's: CREATE : toevoegen van metagegevens DROP : verwijderen

Nadere informatie

Kleine cursus PHP5. Auteur: Raymond Moesker

Kleine cursus PHP5. Auteur: Raymond Moesker Kleine cursus PHP5 Auteur: Raymond Moesker Kleine cursus PHP PHP is platform en CPU onafhankelijk, open source, snel, heeft een grote userbase, het is object georiënteerd, het wordt omarmd door grote bedrijven

Nadere informatie

Deel 1: Arduino kennismaking. Wat is een microcontroller, structuur van een programma, syntax,

Deel 1: Arduino kennismaking. Wat is een microcontroller, structuur van een programma, syntax, Deel 1: Arduino kennismaking Wat is een microcontroller, structuur van een programma, syntax, Wat is een microcontroller Wat is een microcontroller? Microcontroller = kleine dedicated computer. - Beperkt

Nadere informatie

DDS chips. DDS = Direct Digital (frequency) Synthesis. Output = sinusvormig signaal. Maximum frequentie = ½ klokfrequentie

DDS chips. DDS = Direct Digital (frequency) Synthesis. Output = sinusvormig signaal. Maximum frequentie = ½ klokfrequentie www.arduino.cc Arduino en DDS DDS chips DDS = Direct Digital (frequency) Synthesis Output = sinusvormig signaal Maximum frequentie = ½ klokfrequentie Frequentie bepaald door tuning word Grootste fabrikant:

Nadere informatie

Interne voorstelling. types en conversies. Binaire en andere talstelsels. Voorstelling van gegevens: bits en bytes

Interne voorstelling. types en conversies. Binaire en andere talstelsels. Voorstelling van gegevens: bits en bytes Interne voorstelling types en conversies Het geheugen wordt ingedeeld in een aantal gebieden van gelijke grootte. Een gebied van 8 bits noemt men een byte (nible een groep van bits). Een (computer)woord

Nadere informatie

Presentatie Michiel. Informaticastage najaar 2004

Presentatie Michiel. Informaticastage najaar 2004 Presentatie Michiel michielborkent@gmail.com Informaticastage najaar 2004 Inhoud presentatie: Wie ben ik? Over mijn stage Informatie over Lisp Wie/wat ben ik? Student Technische Informatica, Universiteit

Nadere informatie

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead 7.1 Exploring Combinations of Ten Look at these cubes. 2. Color some of the cubes to make three parts. Then write a matching sentence. 10 What addition sentence matches the picture? How else could you

Nadere informatie

Programmeren in C# Interfaces. Hoofdstuk 23

Programmeren in C# Interfaces. Hoofdstuk 23 Programmeren in C# Interfaces Hoofdstuk 23 Programmeren in C# 2 Gradaties overerving Klassieke overerving Iets functioneels uitbreiden Code duplicatie Niet teveel aanpassingen aan bestaande code Objecten

Nadere informatie

Tentamen Programmeren in C (EE1400)

Tentamen Programmeren in C (EE1400) TU Delft Faculteit EWI Tentamen Programmeren in C (EE1400) 28 jan 2011, 9.00 12.00 - Zet op elk antwoordblad je naam en studienummer. - Beantwoord alle vragen zo nauwkeurig mogelijk. - Wanneer C code gevraagd

Nadere informatie

Ontwerp van Informatiesystemen

Ontwerp van Informatiesystemen 1ste bach HIB Ontwerp van Informatiesystemen Prof. Verelst Q www.quickprinter.be uickprinter Koningstraat 13 2000 Antwerpen 112 2,50 Online samenvattingen kopen via www.quickprintershop.be Table of Contents

Nadere informatie

VAN HET PROGRAMMEREN. Inleiding

VAN HET PROGRAMMEREN. Inleiding OVERZICHT VAN HET PROGRAMMEREN Inleiding Als je leert programmeren lijkt het nogal overweldigend om die eerste stappen te doorworstelen. Er zijn dan ook heel wat programmeertalen (Java, Ruby, Python, Perl,

Nadere informatie

Programmeren (1) Examen NAAM:

Programmeren (1) Examen NAAM: Schrijf al je antwoorden op deze vragenbladen (op de plaats die daarvoor is voorzien) en geef zowel klad als net af. Bij heel wat vragen moet je zelf Java-code schrijven. Hou dit kort en bondig. Je hoeft

Nadere informatie

Variabelen en statements in ActionScript

Variabelen en statements in ActionScript Ontwikkelen van Apps voor ios en Android Variabelen en statements in ActionScript 6.1 Inleiding Als we het in de informatica over variabelen hebben, bedoelen we een stukje in het geheugen van de computer

Nadere informatie

Programmeren in Java 3

Programmeren in Java 3 2 september 2007 voor deeltijdstudenten Kop van Zuid Rotterdam, 3 juni 2007 Even voorstellen Naam: Wessel Oele(31) Docent bij opleiding technische informatica Kamer: I210 (tweede verdieping, links de gang

Nadere informatie

SPOJ oplossingen Gilles Callebaut 7 augustus 2015

SPOJ oplossingen Gilles Callebaut 7 augustus 2015 SPOJ oplossingen 2012-2013 Gilles Callebaut 7 augustus 2015 DISCLAIMER Oefeningen zijn niet altijd correct of optimaal. Gelieve de oefeningen enkel te gebruiken ter ondersteuning. Van kopiëren leer je

Nadere informatie

Programmeren in C++ Efficiënte zoekfunctie in een boek

Programmeren in C++ Efficiënte zoekfunctie in een boek Examen Software Ontwikkeling I 2e Bachelor Informatica Faculteit Wetenschappen Academiejaar 2010-2011 21 januari, 2011 **BELANGRIJK** 1. Lees eerst de volledige opgave (inclusief de hints/opmerkingen)!

Nadere informatie

Inleiding Programmeren 2

Inleiding Programmeren 2 Inleiding Programmeren 2 Gertjan van Noord November 28, 2016 Stof week 3 nogmaals Zelle hoofdstuk 8 en recursie Brookshear hoofdstuk 5: Algoritmes Datastructuren: tuples Een geheel andere manier om te

Nadere informatie

Niet-numerieke data-types

Niet-numerieke data-types Intern wordt een karakter voorgesteld als een rij van acht bits, Niet-numerieke data-types string de letter a 01100001 0110 0001 0x61 97 Bij interpretatie van de inhoud van een byte als een geheel getal,

Nadere informatie