# 8. Loops I

44 %
56 %
Education

Published on February 24, 2014

Author: JosephHenryMurphy

Source: slideshare.net

From last time… • We played with Pong! • Please turn in Homework 1

Proposal! Feedback CAP

Proposals • Check your email, take action if needed! • Scope, deﬁnition, and clariﬁcations! • Thoughts and examples! • Think of this as a loose ‘contract’! • Next steps: iteration plan and group formation

What is Agile? CAP

(Semi-) Agile • Follow “user stories” rather than speciﬁcations! • Frequent check-ins (scrums) with your team! • 2 week development cycles (sprints)! • We will be meeting in groups on a regular basis, will have quick scrums, then show off our work, ~ 3 week development sprints

Looooooooops CAP

while() while (conditional_statement) { // execute this code }

Demo! While Loops

Inﬁnite Loops (!!!) while (conditional_statement) { // execute this code } • If your conditional statement is never going to be false, the loop will never stop executing! • This is bad.

for() for (int i = 0; i < 10; i++) { print(i); } ! 0123456789

1. Initialization • Declare and initialize a variable! • Most often: • This could be used as a counter inside the loop, or could be ignored within the loop for( int i = 0;

2. Boolean Test • Create a conditional statement that must evaluate to true or false! • Most often: • We’ve seen these conditional statements before i < numberOfIterations;

3. Iteration Expression • What happens at the end of each loop?! • Most often: • Increment or decrement are common here i++) {}

Memorize the For Loop for (int i = 0; i < 10; i++) { print(i); } ! These are extremely helpful in many ways and you will use them often

Demo! Nested For-Loops

For next time… • Read and respond to your proposal feedback (if you haven’t already)! • Memorize the for loop! • Read Shiffman, p. 90–98 (Loops II)! • Also… start thinking about Iteration 1

 User name: Comment:

## Related presentations

October 31, 2018

#### Post-holiday seeking Chemistry Tutor

November 14, 2018

#### Presentacion_4.4

November 14, 2018

#### H31-321 Cheat Sheet

November 14, 2018

#### C_SM100_7203 Cheat Sheet

November 14, 2018

#### Sustaining future growth with millennial leaders 2...

November 14, 2018

## Related pages

### FL Studio - Download - CHIP - CHIP - Deutschlands Webseite ...

FL Studio 12.2 Englisch: Komponieren wie David Guetta & Co. - kein Problem dank "FL Studio" (vormals Fruity Loops). Die DJ- und Audio-Software bietet Tools ...

### Download fruity loops 8 - Die besten Apps - News, Artikel ...

Kostenloser Download fruity loops 8 - FL Studio 12.0.2.1: Leistungsfähiger Sequenzer, Synthesizer und Loop-Spezialist, und mehr programs.

### 8LoopsRecords Musik Label Köln

Wir freuen uns, Ihnen mitteilen zu können, dass 8 Loops Records mit der Intergroove Media GmbH einen geeigneten Vertriebspartner gefunden ...

### Java 8: No more loops - Dead Code Rising

As I've written before, the new functional features in Java 8 is a game changer. It’s a new world for the Java developer and it's time to adjust to it.

Loopmasters Pro Sample Cds, Sample Boutique, Downloadable Samples, Royalty Free Sample Libraries, Rex Files, Reason Refills and Dance Samples for ...

### Loops & Tings (2008 Mixes) (8-Track Maxi-Single ...

Loops & Tings (2008 Mixes) (8-Track Maxi-Single) Mike Nero. 2008 • 8 Musiktitel • Electronic / Dance • Dance • Active Sense Records