Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sequenz Learning By Doing // Tu01.java import ch.aplu.turtle.*;

Similar presentations


Presentation on theme: "Sequenz Learning By Doing // Tu01.java import ch.aplu.turtle.*;"— Presentation transcript:

1 Sequenz Learning By Doing // Tu01.java import ch.aplu.turtle.*;
class Tu01 { Tu01() Turtle john = new Turtle(); john.forward(20); john.right(90); john.left(90); } public static void main(String[] args) new Tu01();

2 Iteration: while-Struktur
Learning By Doing Iteration: while-Struktur // Tu02.java, while-Struktur import ch.aplu.turtle.*; class Tu02 { Tu02() Turtle john = new Turtle(); int i = 0; while (i < 5) john.forward(20); john.right(90); john.left(90); i++; } public static void main(String[] args) new Tu02(); while (Bedingung) { Anweisungen; }

3 do-while-Struktur Learning By Doing do { Anweisungen;
// Tu03.java, do-while-Struktur import ch.aplu.turtle.*; class Tu03 { Tu03() Turtle john = new Turtle(); int i = 0; do john.forward(20); john.right(90); john.left(90); i = i + 1; } while (i < 5); } public static void main(String[] args) new Tu03(); do { Anweisungen; } while (Bedingung)

4 for - Struktur Learning By Doing
// Tu04.java, for - Struktur import ch.aplu.turtle.*; class Tu04 { Tu04() Turtle john = new Turtle(); for (int i = 0; i < 5; i++) john.forward(20); john.right(90); john.left(90); } public static void main(String[] args) new Tu04(); for (Initialisierung; Bedingung; Wertänderung) { Anweisungen; }

5 Selektion: if – else - Struktur
Learning By Doing Selektion: if – else - Struktur // Tu05.java, if - else - Struktur import ch.aplu.turtle.*; class Tu05 { Tu05() Turtle john = new Turtle(); for (int i = 0; i < 100; i++) john.forward(2); if (i < 50) john.left(3.6); else john.right(3.6); } public static void main(String[] args) new Tu05(); if (Bedingung) { Anweisungen; } else Alternativanweisungen;

6 switch - Struktur Learning By Doing switch (ausdruck) { case wert1:
// Tu06.java, switch - Struktur import ch.aplu.turtle.*; class Tu06 { Tu06() Turtle john = new Turtle(); for (int i = 0; i < 4; i++) switch(i) case 0: john.forward(20); break; case 1: john.forward(40); default: john.forward(100); } john.left(90); public static void main(String[] args) new Tu06(); switch (ausdruck) { case wert1: Anweisungen; break; case wert2: default: }


Download ppt "Sequenz Learning By Doing // Tu01.java import ch.aplu.turtle.*;"

Similar presentations


Ads by Google