Presentation is loading. Please wait.

Presentation is loading. Please wait.

Repetition Structures: Nested Loops CSC 1401: Introduction to Programming with Java Week 6 – Lecture 2 Wanda M. Kunkle.

Similar presentations


Presentation on theme: "Repetition Structures: Nested Loops CSC 1401: Introduction to Programming with Java Week 6 – Lecture 2 Wanda M. Kunkle."— Presentation transcript:

1 Repetition Structures: Nested Loops CSC 1401: Introduction to Programming with Java Week 6 – Lecture 2 Wanda M. Kunkle

2 Nested Loops Nested loops are simply loops placed inside of other loops. Nested loops are simply loops placed inside of other loops. We can nest: We can nest: for loops within for loops for loops within for loops while loops within while loops while loops within while loops do-while loops within do-while loops do-while loops within do-while loops while loops within do-while loops while loops within do-while loops etc. etc.

3 Sample Programs Now let’s look at some sample programs that demonstrate nesting loops inside of loops: Now let’s look at some sample programs that demonstrate nesting loops inside of loops: powers.java powers.java powers.java square.java square.java square.java userSquare.java userSquare.java userSquare.java examAverager.java examAverager.java examAverager.java


Download ppt "Repetition Structures: Nested Loops CSC 1401: Introduction to Programming with Java Week 6 – Lecture 2 Wanda M. Kunkle."

Similar presentations


Ads by Google