{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter 5

# Chapter 5 - Daniel Fore Ms Lisa G Henderson October 17 20...

This preview shows pages 1–3. Sign up to view the full content.

Daniel Fore Ms. Lisa G. Henderson October 17 & 20, 2007 CSE-1284-01 Chapters 5 Chapter 5 Homework Pages 288 – 292 Short Answer: 2, 3, 5, 6, 7, 8, 9, 10 Algorithm Workbench: 31, 32, 33, 34, 35 || 36, 37, 38 Find the Errors: 56, 57, 58, 59, 60, 61

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

View Full Document
Chapter 5 Pages 288 – 292 2) Pretest loop – A condition followed by the statements in the loop followed by the end of the loop. Posttest loop – Begins the loop followed by the statements in the loop followed by a condition to determine if the loop will stop. 3) They will only execute if certain conditions by the user are met. 5) A pretest loop 6) A posttest loop 7) Count-controlled loop 8) To be able to keep an accurate number of times the loop runs 9) To be able to keep an accurate running total 10) Because it could skip or duplicate one or more iterations 31) do { loop: cout << “Please enter two numbers to be added together” << endl; cout << “First number: ”<< endl; cin >> numA; cout << “Second number: ”<< endl; cin >> numB; cout << “ ”<< endl; cout << “Your sum is: ”<< sum<< endl; sum == numA + numb keepGoing: cout << “Continue adding (y or n): ”<< endl; cin << cont;
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

Chapter 5 - Daniel Fore Ms Lisa G Henderson October 17 20...

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

View Full Document
Ask a homework question - tutors are online