Unit 4: IterationAP Computer Science AWhat you'll master in this unit•••••The three types of loopsKey loop patternsCounting loop ```java for (int i = 0; i < 10; i++) { System.out.println(i); // prints 0 through 9 } ```Accumulator loop ```java int sum = 0; for (int i = 1; i <= 100; i++) { sum += i; // sum = 5050 } ```Sentinel loop ```java while (input != -1) { // process input input = scanner.nextInt(); } ```String traversal ```java String word = "Hello"; for (int i = 0; i < word.length(); i++) { String ch = word.substring(i, i + 1); System.out.println(ch); } ```Why Unit 4 mattersUnit 4 topicsUnit 4 overview4.1while Loops4.2for Loops4.3Loop Algorithms4.4Nested Loops← Previous3.6 Equivalent ExpressionsNext →4.1 while LoopsPractice AP Computer Science A questions →