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

for friday
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

For Friday

  • Finish reading chapter 3

– Skip section 3.5.2

slide-2
SLIDE 2

Program 1

  • Proposal due by 4pm today
  • Questions?
slide-3
SLIDE 3

Questions before the quiz?

slide-4
SLIDE 4

Quiz

slide-5
SLIDE 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

slide-6
SLIDE 6

Algorithms

  • Good algorithms are

– Correct – Easy to read and understand – Easy to debug – Easy to modify (why?) – Efficient

slide-7
SLIDE 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

slide-8
SLIDE 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.

slide-9
SLIDE 9

Stepwise Refinement

  • What’s the basic idea here?
slide-10
SLIDE 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.

slide-11
SLIDE 11
slide-12
SLIDE 12

What route?

  • This shows a

possible route (not counting the actual delivery to the houses)

slide-13
SLIDE 13

Breaking up the Work

slide-14
SLIDE 14

Breaking up DeliverOneAvenue

slide-15
SLIDE 15

Breaking up DeliverOneSide

slide-16
SLIDE 16

DeliverBlock

slide-17
SLIDE 17

So what have we done here?