Chapter 2 IM Answers

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

Info iconThis preview shows pages 1–5. 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 2 Answers CONCEPT LESSON QUESTIONS 1. b analyze the problem 2. b output 3. a input 4. b output 5. b IPO charts 6. a input 7. b entering the input items into the computer 8. c Processing 9. c both what is to be calculated and how to calculate it 10. c entering the input items, then processing the input items, and then displaying, printing, or storing the output items 11. d pseudocode 12. a Flowcharts 13. c process 14. a input/output 15. d 16. c 17. b 18. c desk-check the algorithm 19. d all of the above
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. Input Processing Output original number Processing items: none Algorithm: 1. enter original number 2. calculate the squared value by multiplying the original number by itself 3. display the squared value squared value original number squared value 4 6 16 36 2. Input Processing Output state1 sales state2 sales commission rate Processing items: none Algorithm: 1. enter state1 sales, state2 sales, and commission rate 2. calculate the total commission by adding the state1 sales to the state2 sales, and then multiplying the result by the commission rate 3. display the total commission total commission state1 sales state2 sales commission rate total commission 1000 3000 2000 2500 .05 .06 150 330
Background image of page 2
3. Input Processing Output sales commission rate Processing items: none Algorithm: commission sales commission rate commission 2000 5000 .1 .06 200 300 4. Input Processing Output region1 sales region2 sales region3 sales region1 increase region2 increase region3 increase Processing items: none Algorithm: 1. enter the region1 sales, region2 sales, region3 sales, region1 increase, region2 increase, and region3 increase 2. calculate the region1 projected sales by multiplying the region1 sales by the region1 increase 3. calculate the region2 projected sales by multiplying the region2 sales by the region2 increase 4. calculate the region3 projected sales by multiplying the region3 sales by the region3 increase 5. display the region1 projected sales, region2 projected sales, and region3 projected sales region1 projected sales region2 projected sales region3 projected sales start stop enter the sales and commission rate calculate the commission by multiplying the sales by the commission rate display the commission
Background image of page 3

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

View Full DocumentRight Arrow Icon
region1 sales region2 sales region3 sales region1 increase region2 increase region3 increase region1 projected sales region2 projected sales region3 projected sales 10000 5000 3000 2000 6000 1000 .1 .02 .09 .03 .1 .02 11000 5100 3270 2060 6600 1020 5. Input Processing Output original number Processing items: none Algorithm: 1. enter original number 2. if the original number is less than or equal to zero display an error message otherwise calculate the squared value by multiplying the original number by itself display the squared value squared value original number squared value 10 -3 100 6. Results of desk-checking the incorrect algorithm. beginning inventory
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

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

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

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