21
COMPUTER PROGRAMMING I SUMMER 2011 Objective 3.01 Apply Procedures to Develop Flowcharts and Pseudocode (3%)

Objective 3.01 Apply Procedures to Develop Flowcharts and Pseudocode (3%)

  • Upload
    moral

  • View
    52

  • Download
    0

Embed Size (px)

DESCRIPTION

Objective 3.01 Apply Procedures to Develop Flowcharts and Pseudocode (3%). Computer Programming I Summer 2011. Objectives 3.01 and 3.02. Computer Programming I Summer 2011. Objective/Essential Standard. Essential Standard 3.00Apply Programming Logic - PowerPoint PPT Presentation

Citation preview

Page 1: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

COMPUTER PROGRAMMING ISUMMER 2011

Objective 3.01 Apply Procedures to Develop

Flowcharts and Pseudocode (3%)

Page 2: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

COMPUTER PROGRAMMING ISUMMER 2011

Objectives 3.01 and 3.02

Page 3: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Objective/Essential Standard

Essential Standard3.00Apply Programming Logic

Indicator3.01 Apply procedures to develop flow-charts and pseudocode. (3%)

Page 4: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Teacher Notes

This PowerPoint was developed with examples from Visual Basic 2010 and C#.

Any coding samples will be provided in both languages as supported.

Only show the slides the correspond to the language you are teaching.

Page 5: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Flowcharts

Flowcharts help the programmer begin to plan the programming project.

They provide a visual representation of how the data should flow.

They describe the inputs, processes and outputs of the program that are needed to successfully complete the project.

Page 6: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Flowchart Symbols

There are many flowchart programs, however you can also use Microsoft Word to create a flowchart – or just a piece of paper and a pencil.

To create the flowchart, there are different symbols that represent the various parts. We will only use a few of these symbols.

Use lines with arrows to indicate data flow direction.

Page 7: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Flowchart Symbols

Start/Stop

Input/Output

Processes

Decisions

Start should always be the first shape, with a Stop at the end of the flow chart.

This shape is used to show raw materials used for ‘ingredients’ and to show the finished product.Start should be used to show processes/procedures, eg. ‘Bake Cake’

Start should be used to show where the flowchart can divide into two options.

Page 8: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Start

Input

Process A

Output

Stop

Used for Start & Stop

Used for inputs – raw materials Examples: Cake Ingredients Plastic, metal

Used for outputs – finished product Examples: Finished cake Car door

Process B

InputUsed for all processes Examples: Bake cake Review music choices Build wheels

Page 9: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Start

Input

Process A

Output

Process B

Stop

Used for Start & Stop

Used for inputs – raw materials Examples: Cake Ingredients Plastic, metal

Used for outputs – finished product Examples: Finished cake Car door

Used for all processes Examples: Bake cake Review music choices Build wheels

If Process A

True (yes) False (no)

Process C

Used for decision making - Questions

Page 10: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Start

Input

Process A

NO PROCESSES ALLOWED

HERE!!!!Exit only

Stop

Used for Start & Stop

Used for inputs – raw materials Examples: Cake Ingredients Plastic, metal

Used to show where loop stops – required.

DOWHILE Question (T or F)

True (yes)

False (no)

Process B

Used for decision making - Questions

ENDDO

Page 11: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Using Microsoft Word to Create a Flowchart

Open Microsoft Word.

Under Insert choose Shapes

Look down the list until you see Flowchart.

Hoover your mouse over a shape, you will see a popup telling you what that shape is used for.

Page 12: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Using Microsoft Word to Create a Flowchart

Select and draw the shapes needed for your program logic.

Once you draw a shape you can right click and select Add Text to enter information into your symbol.

Join your symbols using arrows indicating program data flow.

Page 13: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Pseudocode

The text in your flowchart symbols is your pseudocode.

Pseudocode is a mix of English language and code that represents what you want your program to do.

It helps you determine how you want the program to work as well as what variables and methods/functions you will want to include.

Developing pseudocode will help you work through your logic, reducing the number of errors and potential re-writes you will have to do.

Page 14: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Pseudocode Example

Proceed down Main Street for two milesTurn left on Ocean Drive,Proceed on Ocean Drive for three blocks, to the fork.IF left turn at fork is blocked THEN

Take a right turn at the fork onto Eagle Street…ELSE

At the fork, take Swan Street to the left.Proceed two blocks.House is second on the left. (246 Swan Street.)

ENDIF

Page 15: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Example

Proceed down hallTurn left at first intersecting hallwayIF hungry THEN

Turn right into the cafeteriaELSE

Continue to classroomENDIf

Stop

Proceed down hallTurn left at first

intersecting hallway

Hungry?

Turn right into

cafeteria

Continue to

classroom

Start

Page 16: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

COMPUTER PROGRAMMING ISUMMER 2011

Objective 3.02Understand Algorithms (3%)

Page 17: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Objective/Essential Standard

Essential Standard3.00Apply Programming Logic

Indicator3.02 Understand Algorithms (3%)

Page 18: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Algorithm

An algorithm is a list of steps to solve a problem.

In programming, it will be a list of steps used to successfully accomplishment your programming task.

Your algorithm is not only going to tell your program what to do but how to do it.

Page 19: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Algorithm Example – Going Home

The Walk Algorithm1. Leave classroom2. Turn right out of school building3. Walk 1.2 miles4. Turn right on street5. Go to 4th house

The Bus Algorithm1. Go to the bus area2. Get in right bus3. Go to house

Page 20: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Algorithms

Both algorithms, and others that accomplish the same task (of getting you home).

There are advantages and disadvantages associated with each option.

You have to consider each option and its advantages/disadvantages before you choose the algorithm you want to continue developing into your program.

Page 21: Objective 3.01   Apply Procedures to Develop  Flowcharts and  Pseudocode  (3%)

Conclusion

This PowerPoint provided an overview of creating flowcharts.

Next step is to practice with sample programs the skilled students have learned! The Unpacked Content will provide some sample programs.