for friday
play

For Friday Finish reading chapter 3 Skip section 3.5.2 Program 1 - PowerPoint PPT Presentation

For Friday Finish reading chapter 3 Skip section 3.5.2 Program 1 Proposal due by 4pm today Questions? Questions before the quiz? Quiz Algorithms An algorithm is a set of instructions for accomplishing some task What are


  1. For Friday • Finish reading chapter 3 – Skip section 3.5.2

  2. Program 1 • Proposal due by 4pm today • Questions?

  3. Questions before the quiz?

  4. Quiz

  5. Algorithms • An algorithm is a set of instructions for accomplishing some task • What are some common algorithms from everyday life? • Important characteristics of algorithms for computers

  6. Algorithms • Good algorithms are – Correct – Easy to read and understand – Easy to debug – Easy to modify (why?) – Efficient

  7. Pseudocode Algorithms • Let us focus on the algorithm, not the details of Java, first • Combines natural language with structure • Very important as we move on to writing programs that make decisions next week. • Example: – GardenerBot algorithms on board

  8. Advantages of Pseudocode • Pseudocode helps us think more abstractly, allowing us to ignore many irrelevant details. • Pseudocode allows us to trace our programs very early in development. • Pseudocode can provide a common language on a development team, even with non-technical users. • Algorithms expressed in pseudocode can be implemented in a variety of programming languages.

  9. Stepwise Refinement • What’s the basic idea here?

  10. Delivering Flyers • You need a robot to deliver flyers to houses on a delivery route. The route is shown on the next slide. The robot must visit all of the houses on the route and should stay off the green areas as much as possible.

  11. What route? • This shows a possible route (not counting the actual delivery to the houses)

  12. Breaking up the Work

  13. Breaking up DeliverOneAvenue

  14. Breaking up DeliverOneSide

  15. DeliverBlock

  16. So what have we done here?

Recommend


More recommend