what is a flowchart? - edl · what is a major difference between humans and computers? ... and why...

32
Flowcharts Unit 2: Algorithm Development

Upload: vuonghanh

Post on 06-Jul-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Flowcharts

Unit 2: Algorithm Development

Vocab Quiz Unit 1

Warm Up: Get out a scratch piece of paper (I have some by the pencil sharpener if you need)

1. Draw a dot in the center of the page.

2. Starting at the top left-hand corner of the page rule a straight line through the dot finishing at the bottom right hand corner.

3. Starting at the bottom left-hand corner of the page rule a line through the dot, finishing at the top right hand corner.

4. Write your name in the triangle in the center of the left-hand side of the page.

How important is it for instructions to be well

written?

trying another one verbally!

Ch 11A Intro: Program Development

What is computer programming?

Computer programming encompasses a broad set of activities that include planning, coding, testing, and documenting.

A related activity is software development which is a development process that uses mathematical, engineering, and management techniques to reduce the cost and complexity of a computer program while increasing its reliably and modifiability.

What is program code? The instructions that make up a computer program

What are Programming languages? A special language programmers use to develop software programs, scripts, or other sets of instructions for computers to execute

There are high-level languages(which use command words and grammar based on human languages) and low-level languages (which have a low level of abstraction because it includes commands specific to a particular CPU or microprocessor family. Examples include machine language and assembly languages )

What is a major difference between humans and computers?

The traditional approach to programming uses a procedural paradigm to conceptualize the solution to a problem as a sequence of steps. A program written in a procedural language consist of self-contained instructions in a sequence that

indicates how a task is to be performed.

****Procedural languages are well suited for problems that can be solved easily with a linear, step-by-step algorithm.

But wait – what is a algorithm?

An algorithm is a set of steps for carrying out a task that can be written down and implemented. For example, the algorithm for making a batch of mac n cheese is a set of steps that includes boiling water, cooking he macaroni in the water, and making a cheese sauce.

Why is it important that programs are well-written?

You can express an algorithm in several different ways

1) Structured English – a subset of the English language with a limited selection of sentence structures that reflect processing activities

2) Psuedocode – a notational system for algorithms that is less formal than a programming language, but more formal that simply jotting down notes. Incorporates key words and syntax they intend to use in the actual program.

3) Flowcharts – a graphical representation of the way a computer should progress from one instruction to the next when it performs a task.

And why is a flowchart useful?

Sometimes it's more effective to visualize something graphically than it is to describe it with words. That is the essence of what flowcharts do for you.

Flowcharts explain a process clearly through symbols and text.

Flowcharts give you the gist of the process flow in a single glance.

Examples:

What would be the psuedocode?

1) Leave home2) Check the time –

Is it before 7am?3) If it is before

7am, take the bus4) If it is not before

7am, then take the subway

5) Arrive at school

1) Check if the computer is on2) If it is turned on, check for any

error messages3) If there are error message,

perform a search4) If there are no error messages,

the computer is fine and you can use it!

5) If the computer does not turn on, check if the power light is on

6) If the power light is on, turn the monitor on

7) If the power light is not on, check the computer power cord

Homework over the weekend

Choose a favorite song (maybe one with a longer chorus) to flowchart!

Choose whatever part of the song you think would be easiest to flowchart

You don’t need formal symbols

HW: Map a song!

Too simple of an example… but fun :]

Day 2

1) Share your song flowchart with your group members. Then make a pile for me to collect2) Warm Up: What does this flowchart do?3) Grab your board game and start playing. I will put up your instructions for that soon.

calculation

Decision

Symbols (also pg 781 in textbook)

Board Game Flow Chart Activity

Choose a game to play with your table group. Agree on the rules, then begin. You have about 10 minutes.

After getting the game started, start to pay attention to points where you have to “make a decision” or “loop” back to a previous place.

You will be making a flowchart of the by hand, using the formal symbols.

EX: Clue

Now with your groups, make PSUEDOCODE for the game

Clue Pseudo Code• The players start the game

• If it is the player’s turn, roll the dice

• If it is not the player’s turn, and someone is making an accusation, then the player may try to prove them wrong if they happen to be on the accuser’s left, or if the people to the player’s left have no cards to null their accusation

• If someone is not making an accusation, then the player simply needs to wait their turn

• If it is the player’s turn, they may roll the dice, but if they are in a room with a secret passage, however, then they can choose not to roll and instead take the secret passage

• If the player is within range of a room, then they may either choose to enter it or continue to move the allocated number of spaces

• If the player chooses to enter a room, they may make an accusation using a weapon, a person, and the room they are currently standing in

• If someone proves the player wrong, they may check off their card and continue playing

• If nobody is able to prove the player wrong, then the player may finalize his decision and look inside of the file folder containing the murder suspect

• If the folder does not match the player’s accusation, then the player is out of the game

• If the folder matches, however, then the player wins the game

Now switch with a group near you and try to play their game with their instructions.

• Make any edits in PENCIL

• (Check their symbols)

Thoughts ?

• What are the difficulties or challenges in following ONLY the provided sequence and without use of prior knowledge or human decision making?

• What are examples of effective diagramming and clear sequencing?

• What is the importance of clear and specific directions when programming a computer as devices are not using prior knowledge or artificial intelligence (yet!)?

Project: Due

Project EX

Unit 1 and 2 Test Study Guide• Boolean Operators

• Binary and Hexadecimal conversions

• Bytes/ Kilobytes/Megabtye etc. conversions.

• Robot Algorithms

• Unit 1 and 2 VOCAB (review ALL definitions)

There will be a section of 5 fill in the blank from Unit 2

There will be some “Free-Response” questions

• Ch 1A, 1C ** Complete QuickChecks and QuickQuizzes for good practice (may be possible test questions)

There will be some “Free-Response” questions

Might be a few(2-3) multiple choice

• Ch 1D **Basically just know the main DIFFERENCES between bitmaps and vector graphics. This will be a likely free response question on the test.

• Logic Gates

This document is online!