Flowcharts and Algorithms
Flowcharts
- A flowchart visually represents and organizes the steps used to write a program or solve a problem
- It is a diagram of the “flow” of the process. An alternative to pseudocode that uses shapes connected by lines to breakdown an algorithm into all the necessary steps of a process
- In other words, it simplifies the whole aspect of a problem and leads to a step-by-step solution to a problem
- Break the problem down into smaller, more specific steps in a flowchart.
- Then, go back and see if you can break down any of those behaviors into simpler parts.
- Keep on repeating this process until you’ve reached steps that are simple and precise
- Break the problem down into smaller, more specific steps in a flowchart.
- Enable programmers to work these steps out before needing to translate their processes into actual code
What do the symbols mean:
Selection / Conditional / Decision
Samples:
Notice how each of the flowcharts shows increased detail.
Task - Creating Several Flowcharts:
Real Life Possibilities:
Mathematical Process (These are only some ideas)
Evaluation:
- Should you do your homework?
- Process of ordering a food and drink
- Baking a cake / cookies
- Getting ready for school in the morning (from alarm to out the door)
- Crossing the street
- Taking a bath
- Making Tea
- Tying a shoelace
- Making a sandwich, or a cake, or Kraft Dinner
- How to make pancakes
- Shopping for a new dress
Mathematical Process (These are only some ideas)
- Have user enter in three numbers, then calculate and display the average
- Have user enter in the length and width of a rectangle, then calculate and display the area
- Given the 3 dimensions of a box (length, width, and height), calculate the volume.
- Have user enter in the quantity of widgets order, then have computer calculate and display prices including taxes
- Find the sum and average of 5 numbers
- Have user enter in an unknown quantity of positive numbers. The user will enter "0" to let signal that their list is complete. Computer will add the numbers together and output the average.
- Sort numbers according to whether they are even or odd
- Convert temperature Fahrenheit to Celsius
- User enters the length of three sides of a triangle (a, b, c). Program then classifies triangles according to whether they are equilateral, isosceles or scalene.
- Takes 4 marks or test scores from the user, calculates and outputs the average and then tells the user their letter grade based on the following guidelines: A = 86-100, B = 73-85.9, C+ = 67-72.9, C = 60-66.9, C- = 50-59.9, F < 50
- Could the program be modified to allow user to specify how many scores will be entered?
- Dice game of craps
- Program for Aunt Ellen's Egg Ranch. The user will enter the number of eggs gathered and the program will output the number of dozens as well as the number of excess eggs. Continue this process until a negative number is entered.
- Create a number guessing game, where the computer randomly generates a number within a specific range (ex. 1 - 100). The computer then prompts the player for guesses, providing hints of too high, too low, keeping track of guesses until either the number is guessed or the player runs out of guesses. Think of ways to complicate the game and to allow the player to repeat the game for a different number.
- Obtain from the user an hourly pay rate and the number of hours worked for the week. Have the program calculate and output the user's weekly pay according to the following:
- Regular pay is the pay up to 40 hours
- Overtime pay is pay for the hours over 40
- Overtime is paid at a rate of 1.5 times the hourly rate
- Gross pay is the sum of the regular pay and the overtime pay.
- Write a program that will take as input the type of restaurant the user ate at, the cost of the meal, the number of people in his/her party, and how good the service was. Determine the dollar amount of the tip.
- Have the user enter in a series of numbers and have the computer arrange or sort them in numerical order
- Have the user enter in a series of words and have the computer arrange in alphabetical order (ascending or descending)
Evaluation:
- Complexity of scenario - is it as detailed as possible
- Basic steps
- Larger basic steps broken down into smaller more detailed steps
- Use of subroutines and loops to optimize the code
- Example getting ready for school, you can have several sub-routines for brushing your teeth, taking a shower, making breakfast etc.
- Organization and presentation
making_the_tea_task.docx |
Online Flowchart Makers to Try
- https://www.lucidchart.com - business option for flowcharts
- http://creately.com/diagram-type/flowchart or https://creately.com/
- Grafio - ipad app to create flow charts
The purpose is to learn about sequencing and modelling a sequence of instructions.
As a challenge: try to repeat the trick and produce the step-by-step instructions
How could we optimize the instructions. I tried to get them to use words such as repeat or loop. I then asked the students to suggest possible
- See more at: http://teachwithict.weebly.com/computing-blog/category/algorithms#sthash.R3LsJPGz.dpuf
As a challenge: try to repeat the trick and produce the step-by-step instructions
How could we optimize the instructions. I tried to get them to use words such as repeat or loop. I then asked the students to suggest possible
- See more at: http://teachwithict.weebly.com/computing-blog/category/algorithms#sthash.R3LsJPGz.dpuf