0% found this document useful (0 votes)
23 views8 pages

Working With Loops in Java Presentation With Notes

The document outlines the teaching demonstration on working with loops in Java, covering types of loops, syntax, common mistakes, and a practice activity. It emphasizes the importance of selecting the appropriate loop type and testing for boundary conditions. An assessment method includes a quiz and a live coding problem to reinforce learning.

Uploaded by

Neeharika Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Working With Loops in Java Presentation With Notes

The document outlines the teaching demonstration on working with loops in Java, covering types of loops, syntax, common mistakes, and a practice activity. It emphasizes the importance of selecting the appropriate loop type and testing for boundary conditions. An assessment method includes a quiz and a live coding problem to reinforce learning.

Uploaded by

Neeharika Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Working with Loops in Java

Candidate Teaching Demonstration


Northwood Technical College
Agenda
• 1. Types of Loops in Java
• 2. Loop Syntax & Structure
• 3. Common Mistakes & Debugging
• 4. Practice Activity
• 5. Assessment Method
Types of Loops in Java
• • for loop – when the number of iterations is
known
• • while loop – entry-controlled loop
• • do-while loop – exit-controlled loop
• • enhanced for loop – used for
arrays/collections
Loop Syntax Examples
• for (int i = 0; i < 5; i++) { ... }
• while (condition) { ... }
• do { ... } while (condition);
• for (int num : array) { ... }
Common Mistakes in Loops
• • Infinite loops (missing increment or wrong
condition)
• • Off-by-one errors (e.g., i <= [Link])
• • Misplaced semicolon (for (int i = 0; i < 5; i+
+);)
• • Modifying collection during iteration
Practice Activity
• • Identify the errors in the given loop
• Example:
• int i = 0;
• while (i < 5) {
• [Link](i);
• // missing increment => infinite loop
Assessment Method
• • Quick 3-question quiz at the end of class
• • Live coding problem: use loop to sum array
• • Exit ticket: describe one loop type and use
case
Summary
• • Loops are fundamental for controlling flow
• • Choose the loop based on your use case
• • Always test for boundary conditions
• • Practice helps in mastering syntax and logic

You might also like