Chapter 7 IM Answers

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

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

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; )

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

View Full Document
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.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern