Presentation is loading. Please wait.

Presentation is loading. Please wait.

1. Check reaction 2. Check water 3. Check heater 4. Check gas

Similar presentations


Presentation on theme: "1. Check reaction 2. Check water 3. Check heater 4. Check gas"— Presentation transcript:

1 1. Check reaction 2. Check water 3. Check heater 4. Check gas
Assignment 3 Zhiyong Yang CS10051 Summer, 2006 Instructor: Dean Zeller Check reaction 1. Check stirring 2. Check color 3. Check odor 4. Check meter 5. Check flask 6. END Check meter 1. Check system 2. Check protect gas 3. Check branch gas 4. Check temperature 5. Check vacuum gauge 6. END Check safety 1. Check reaction 2. Check water 3. Check heater 4. Check gas 5. Check solvent 6. END Check water 1. Check tap water 2. Check condensing water 3. Check distilled water 4. Check running water 5. Check valves 6. END Check running water 1. Check intake pump 2. Check pipes 3. Check connections 4. Check outlet 5. Check rate 6. END Ready go home 1. Check safety 2. Wash hands 3. Sign notes 4. Turn off lights 5. Lock door 6. END Wash hands 1. Remove gloves 2. Throw gloves 3. Rinse hands 4. Apply soap 5. Rinse 6. Wipe dry 7. END

2 Instructor: Dean Zeller
Assignment 4 Zhiyong Yang CS10051 Summer, 2006 Instructor: Dean Zeller

3 Program 1: Counting (Start, End)
Steps for counting with start and end Set I to start While I < = end Do output I set I to I + 1 Endwhile While I >= end Do set I to I – 1 Stop Execution history Input: start = 21, end = 25 1. Steps for counting with start and end 2. Set I to start 3. While I <= end Do 4. output I 5. set I to I + 1 6. Endwhile 7. While I <= end Do 8. output I 9. set I to I + 1 10.Endwhile 11.While I <= end Do 12. output I 13. set I to I + 1 14.Endif 15.While I <= end Do 16. output I 17. set I to I + 1 18.Endwhile 19.While I <= end Do 20. output I 21. set I to I + 1 22.Endwhile 23.While I <= end Do 24.stop output 21 22 23 24 25 26 Analysis Total iteration number N = 5 N = (END – START) + 1 Total executive lines: 23 4N + 3

4 Program 2: Meet in the middle (Bottom, Top)
Steps for meet with bottom and top If bottom > top then set temp to bottom set bottom to top set top to temp Endif While bottom < top Output bottom Output top Set bottom to bottom + 1 Set top to top – 1 Endwhile Stop Execution history output Input: bottom = 3, top = 7 1. Steps for meet with bottom and top 2. If bottom > top then 3. endif 4. While bottom < top 5. Output bottom 3 6. Output top 7 7. Set bottom to bottom 8. Set top to top – 1 6 9. endwhile 10. If bottom > top then 11. endif 12. While bottom < top Output bottom 4 Output top 6 Set bottom to bottom +1 5 Set top to top 17. endwhile 18. If bottom > top 19. Endif 20. While bottom < top 21. Endwhile 22. stop Analysis Total iteration number N = 2 N = (bottom - top)/2 Total executive lines: 22 8N + 6

5 Program 2: Meet in the middle (Bottom, Top)
Steps for meet with bottom and top If bottom > top then set temp to bottom set bottom to top set top to temp Endif While bottom < top Output bottom Output top Set bottom to bottom + 1 Set top to top – 1 Endwhile Stop Execution history output Input: bottom = 25, top = 21 1. Steps for meet with bottom and top 2. If bottom > top then 3. Set temp to bottom 25 4. set bottom to top 21 5. Set top to temp 25 6. endif 7. While bottom < top Output bottom 21 Output top 25 10. Set bottom to bottom 11. Set top to top 12. endwhile 13. If bottom > top 14. endif 15. While bottom < top Output bottom 22 Output top 24 Set bottom to bottom Set top to top 20. endwhile 21. If bottom > top 22. Endif 23. While bottom < top 24. Endwhile 25. stop Analysis Total iteration number N = 2 N = (bottom - top)/2 Total executive lines: 25 8N + 9

6 Program 4: Sort 3 (A, B, C) Steps for sort of A, B and C If A > B then set temp to B set B to A set A to temp Endif If B > C then Set temp to C Set C to B Set B to temp Output A Output B Output C Stop Execution history output Input: A = 23 B = 18 C = 9 A B C temp 1. Steps for sort of A,B and C 2. If A > B then 3. Set temp to B 4. Set B to A 5. Set A to temp 6. Endif 7. If B > C then Set temp to C Set C to B Set B to temp 11.Endif 12.If A > B then Set temp to B Set B to A Set A to temp 9 16.Endif 17.Output A 9 18.Output B 19.Output C 20.Stop Analysis Total iteration number N = 3 Total executive lines: 20 5N + 5


Download ppt "1. Check reaction 2. Check water 3. Check heater 4. Check gas"

Similar presentations


Ads by Google