208 Day 07 repetiton1

208 Day 07 repetiton1 - 4002-208Intro. to Prog. [in C++]Day

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4002-208Intro. to Prog. [in C++]Day 07RepetitionObjectivesBasics of a loopOverview of 3 loops in C++Mechanics of a while loopUse of while loop for data validationWriting code to validate input 4002-2082BasicsGroup of statements will be executed multiple times loop bodyA condition determines when the loop exits loop conditionAny type of statements can be inside the loop including other loops.4002-2083QuestionsWhat is the group of statements to be repeated?What is the condition to stop the repetition?Is condition tested before or after the group of statements?Before: pre-test loopAfter: post-test loop4002-2084Overview of loops in C++while loopPre-test loopfor loopPre-test loopUsed mainly as counting loopUsed with arrays to increment indexdo-while loopPost-test loop4002-2085while loopwhile (loop condition){loop body}Loop condition is a Boolean conditionSame as an if statement4002-2086DetailsLoop condition is tested. If condition is...
View Full Document

Page1 / 13

208 Day 07 repetiton1 - 4002-208Intro. to Prog. [in C++]Day

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online