func PrintEvenAfter (_ A:[Int]) { var first = true var prev = 0 for i in A { if !first && i%2==0 { print (prev) } first = false prev = i } 9 4 9 8 5 5 first false prev 5 UNSTRUCTURED PROGRAMMING (conditional and unconditional branching) 10 GOTO 500 30 IF X=7 GOTO 4590 ITERATIVE BLOCK PROGRAMMING / STRUCTURED PROGRAMMING A program is divided into methods. Methods have "blocks": "conditionals" (if/then/else) or "loops" (while for do) OBJECT ORIENTED PROGRAMMING Programs make use of "objects": collections of both methods and data You can use objects for reasons of organization or for group work. Why you should learn objects: Objects provide inheritance. And inheritance provides method overriding. Just as when you write a method, you can give a method parameters so that a user can put any information they want into those parameters. So that your method can solve a problem that you the programmer are aware needs to be solved. With object-oriented design, you can write your program to call a method--EVEN IF YOU THE PROGRAMMER DO NOT KNOW WHAT THAT METHOD IS GOING TO BE. ... fred->report() ... What is the report method? There might be more than one method called report. The first time the code is run, it might call one report method; the next time it might a call a different report method. You the programmer do not know for sure which method will be run at the time you write the program.