Login

Mapping Code Using Outlines and Flow Charts

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: 5 Basic Elements Of Programming

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:05 Outlines and Flowcharts
  • 0:53 Mapping the Project
  • 2:33 Outlines
  • 6:26 Flowcharts
  • 7:42 Continuing Validation
  • 8:17 Lesson Summary
Add to Add to Add to

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Login or Sign up

Timeline
Autoplay
Autoplay
Create an account to start this course today
Try it free for 5 days!
Create An Account
Lesson Transcript
Instructor: Lee Webber

Lee holds a master's degree in Information Systems Management. He has taught college-level computer classes.

Once you have a good understanding of the process you are trying to automate, it's time to start mapping out how your code is going to work. Two tools that are useful in this are outlines and flowcharts. This lesson will teach you how to take your activity 'model' and get ready to turn it into code.

Outlines and Flowcharts

In this lesson, we are going to explore using both outlines and flowcharts to map out how our code will have to flow, or work. An outline is a plan for an approach to a project or problem. We usually think of outlines in connection with a term paper or as a summary of a document. It is also an excellent starting point for any coding project, including mine.

A flowchart is a graphical representation of a process. You may use either an outline, or a flowchart, or both. For example, you might start with an outline and then use it to build a flowchart. Your boss may have a preference for one or the other for documenting your program, so it is important to know both!

Mapping the Project

Let's see how outlines and flowcharts can help us with our coding project. Fred, the owner of the Pancake House, has hired me to program Foobar, a robot who will replace Sue, their retiring cook.

So, for the project, I've drawn a simple activity flowchart. I've used it to start building the code for the prototype demonstration that my robot, Foobar, did for Fred. It was pretty stripped down, with only four activities:

  1. Check the grill
  2. Pour the pancake batter
  3. Flip the pancakes
  4. Plate the pancakes

A simple activity flow chart for the Foobar project.
Project Mapping Flow Chart

Since my goal was just to demonstrate that it was possible for my robot, Foobar, to cook pancakes, I didn't worry about making any of the different flavors of pancakes on the menu or cooking eggs or bacon. And, after a glitch or two, we succeeded, and Fred was encouraged.

But, there was still a lot of work to be done to get Foobar up to Fred's expectations of a competent grill bot. I had more research to do so I could start to get more detailed about what I needed to code. I went back to the Pancake House and spent more time with Sue, the soon-to-retire cook. I needed to have a better and more specific understanding of how she managed all the dishes in one order and how she managed multiple orders. I wound up with some serious activity model flowcharts and was confident that I could work from them to create the ideal competent grill bot. I started with an outline.

Outlines

An outline is a plan, or approach, to a problem or project. We usually think of an outline as the starting point for a term paper or book. Let's see how I migrated from the new activity flowcharts I drew (after I spent more time with Sue) to an outline of the project.

The next logical question for the project seems to be: can Foobar make a complete order for one customer? This is more complicated than just frying up some pancakes, but it is still way less complicated than making a complete order for a table of four. And that, in turn, is way, way less complicated than managing all the orders for all the customers in the Pancake House!

You can see that this activity model is still pretty simple:

End of activity flow chart for Foobar project
flowchart of activity model

We don't do any looping until we get down to actually cooking something. And for right now, I'm pretending that we never suddenly run out of eggs or bacon. That part, known as error handling, comes later.

So, Sue gets the order for one menu item. She reads it, then goes and gets everything she needs to make it, including any extras for the pancakes, like fruit or whipped cream. Next, she prioritizes the items that she has to make. Even though some things take longer to cook than others, everything has to be ready to plate at the same time. So, when someone orders the Lumberjack's Appetizer (pancakes, eggs, sausage, bacon or ham, and hash browns), the hash browns have to be started first because they take the longest. Sue has to figure out the sequence to cook the items in, so they come out at the same time.

So, just Like Sue, when Foobar has started the last item, he should go back to the first one, and check it to see if it needs to be turned or flipped or if it's done. If it needs flipping, flip it, and move to the next item. If not, just move to the next item. If it's done, take it off and plate it. Assuming that all the items were prioritized and started correctly, they should all come off the grill and onto the plate in rapid sequence. Once they are on the plate, Sue garnishes the plate, puts it up, and calls the server.

Let's translate this into an outline. One way to start is to make a list of each activity in the flowchart:

  • Get the order
  • Read the order
  • Get ingredients for pancakes
  • Get side items for order
  • Prioritize the items on the order (what takes the longest, start first)
  • Mix pancake batter with extras
  • Start each item in order of priority
  • Check each item
  • Flip or turn as needed
  • Keep checking until all items are done
  • Plate items
  • Garnish items
  • Set the order up
  • Call the server

Once we have that, we can start adding detail. There is a bit more activity that has to happen between 'read the order' and getting the ingredients for the pancakes and sides:

  • Read the order
  • Check the menu
  • Get the recipes
  • Create a list of ingredients for the order
  • Check that ingredients are available
  • If running low, have prepper set up more
  • Get ingredients for pancakes
  • Get side items for order

And, that's the new stuff. You keep expanding the outline until it covers everything that needs to be coded.

To unlock this lesson you must be a Study.com Member.
Create your account

Register for a free trial

Are you a student or a teacher?
I am a teacher
What is your educational goal?
 Back

Unlock Your Education

See for yourself why 10 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back

Earning College Credit

Did you know… We have over 95 college courses that prepare you to earn credit by exam that is accepted by over 2,000 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it free for 5 days!
Create An Account
Support