Basic structures: conditionals and loops презентация

Слайд 2

If-then-else statement needed if you want to make a decision

If-then-else statement

needed if you want to make a decision
executes a section

of code if a condition (test) evaluates to true
else - provides a secondary option of a particular statement execution
Слайд 3

If-then flow chart

If-then flow chart

Слайд 4

Code example max = b; if (a > b) { max = a; }

Code example

max = b; if (a > b) { max = a; }

Слайд 5

If-then-else flow chart

If-then-else flow chart

Слайд 6

Code example if (a > b) { max = a;

Code example

if (a > b) { max = a; } else {

max = b; }
Слайд 7

“? :” operator max = (a > b) ? a : b;

“? :” operator

max = (a > b) ? a : b;

Слайд 8

Relational operators

Relational operators

Слайд 9

Conditional and bitwise operators

Conditional and bitwise operators

Слайд 10

Conditional-AND (&&)

Conditional-AND (&&)

Слайд 11

Conditional-OR (||)

Conditional-OR (||)

Слайд 12

While loop

While loop

Слайд 13

Code example a = 0; while (a

Code example

a = 0; while (a < 10) { a++; System.out.println("Hello World"); }

Слайд 14

Do-While loop

Do-While loop

Имя файла: Basic-structures:-conditionals-and-loops.pptx
Количество просмотров: 57
Количество скачиваний: 0