Numerical Methods for Engineers

Published by McGraw-Hill Science/Engineering/Math
ISBN 10: 0073401064
ISBN 13: 978-0-07340-106-5

Chapter 2 - Programming and Software - Problems - Page 47: 2.2

Answer

Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Step 9: Start Initialize sum and count to zero Examine top card. If it says “end of data” proceed to step 9; otherwise, proceed to next step. Add value from top card to sum. Increase count by 1. Discard top card Return to Step 3. Is the count greater than zero? If yes, proceed to step 10. If no, proceed to step 11. Step 10: Calculate average = sum/count Step 11: End

Work Step by Step

Step 1: Step 2: Step 3: Step 4: Step 5: Step 6: Step 7: Step 8: Step 9: Start Initialize sum and count to zero Examine top card. If it says “end of data” proceed to step 9; otherwise, proceed to next step. Add value from top card to sum. Increase count by 1. Discard top card Return to Step 3. Is the count greater than zero? If yes, proceed to step 10. If no, proceed to step 11. Step 10: Calculate average = sum/count Step 11: End
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.