Chapter 1 IM Answers

Chapter 1 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 1 Answers CONCEPT LESSON QUESTIONS 1. d sorting 2. c sequence 3. d sequence 4. a an algorithm 5. b repetition 6. c selection 7. b selection 8. a repetition 9. c both repetition and selection 10. b selection
Background image of page 1

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

View Full DocumentRight Arrow Icon
EXERCISES – PENCIL AND PAPER 1. 1. repeat 5 times: walk 2. jump 3. repeat 10 times: walk 4. turn 5. sit 2. 1. repeat 5 times: walk 2. if the box is red, do this: jump otherwise, do this: throw the box out of the way 3. repeat 10 times: walk 4. turn 5. sit 3. Version 1: 1. repeat for each employee: read the salary and years employed if the years employed are greater than or equal to 5, do this: calculate the bonus by multiplying the salary by 2% otherwise, do this: calculate the bonus by multiplying the salary by 1% print the bonus Version 2: 1. repeat for each employee: read the salary and years employed if the years employed are less than 5, do this: calculate the bonus by multiplying the salary by 1% otherwise, do this: calculate the bonus by multiplying the salary by 2% print the bonus 4. Version 1: 1. read the customer’s age and item price 2. if the customer’s age is greater than or equal to 65, do this: assign 10% as the discount rate otherwise, do this: assign 0 as the discount rate 3. calculate the amount due by subtracting the discount rate from the number 1, and then multiplying the result by the item price 4. print the amount due
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.

This note was uploaded on 03/11/2010 for the course CS 343 taught by Professor Katzman during the Spring '09 term at ITT Tech Tucson.

Page1 / 5

Chapter 1 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