Chapter 7 IM Answers

Chapter 7 IM Answers - An Introduction to Programming with...

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

View Full Document Right Arrow Icon
An Introduction to Programming with C++: Fifth Edition 978-1-4188-3618-4 Chapter 7 Answers CONCEPT LESSON REVIEW QUESTIONS 1. c a pretest 2. d a counter 3. c updated 4. b Counters, accumulators 5. d numEmployees = numEmployees + 1; 6. c total = total + sales; 7. d all of the above 8. d while (age >= 0) 9. a sequence b selection 10. a sequence c repetition 11. a sequence b selection 12. a sequence b selection c repetition 13. c sentinel 14. c priming 15. c 5 16. c 6 17. c 4 18. d 12 EXERCISES – PENCIL AND PAPER 1. The following numbers will appear on the screen when the code is processed: 0, 1, 2, 3, and 4. The temp variable will contain the number 5 when the loop stops. temp 0 1 2 3 4 5 2. The following numbers will appear on the screen when the code is processed: 0, 2, and 4. The totEmp variable will contain the number 6 when the loop stops. totEmp 0 2 4 6 3. numStudents = numStudents + 1; (or numStudents += 1; ) 4. quantity = quantity + -5; (or quantity = quantity – 5; or quantity -= 5; ) 5. total = total + sales; (or total += sales; ) 6. total = total + gross; (or total += gross; )
Background image of page 1

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

View Full DocumentRight Arrow Icon
7. The following numbers will appear on the screen when the code is processed: 0, 1, 2, 3, and 4. The temp variable will contain the number 5 when the loop stops. temp
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Chapter 7 IM Answers - An Introduction to Programming with...

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

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