MOD5a - If Statements or Decision Structures (Decisions)

Check How Ready You Are

This section is usually from a Chapter 4 textbook content section. Take a look at the study helps and quiz to see if you need to spend some time here. If you are not an experienced programmer trained in a formal classroom setting you may find some items you should spend extra time studying. Once you feel you have mastered this section you should be ready for our next topic of Decisions. Setting up good decision programs can be one area I struggle with. This is a great reason to use a tool like Raptor. 

Link: Chapter 4 Review

If you are really energetic you might want to try this quiz.

Link: Chapter 4 Quiz

 

Objectives:

The Decision Structure is going to help you give versatility to your program. You will be able to direct instruction to execute some commands and skip others. It is almost like a program that can think. Let's see what we can build.

Color Mixer Project:

We are going to take a look a project from the Gaddis, Program Design & Development book (Chap 4). This project is also in the Gaddis C++ text (Chap 4). Take a look at the project assignment and see what you can do with it. I will review the project requirement first, making some highlights. Then I will look at a very simple Program Analysis Worksheet along with a Hierarch Chart. Finally I will give a 2 part review of an acceptable flowchart. Try your effort first and then watch the videos would be my recommendation.

alternative accessible content

 

Analyze the Project

Analyzing a project is where the wheels start turning. This looks like a very simple project when you first take a look. Then you might consider whether there is a good way and a not so good way to approach the solution. See what you think.

Start the Design with a Program Analysis Worksheet and a Hierarchy Chart

Designing a program may not start out so exciting. Many people want to skip the initial planning. To get this going right you may need to force your effort into the planning stage rather than jump right into trying to build a program.

Now for the Flowchart

The first segment covering the flowchart is a partial item where I will get things started (Part 1). If you have not started you might want to watch this piece on Raptor and then give it your best effort. Wait on watching Parts 2 and 3 till you have at least tried Part 1. Then you could determine if clean-up is needed when you move forward.

(for flowchart demo videos you might want to enlarge to full screen)

Part 1

alternative accessible content

 

Part 2

alternative accessible content

Part 3 

alternative accessible content

 

Feedback for MOD5a

I really appreciate feedback from people who use my site. Each time you complete a subject from the top it would be great if you could go to the last topic (Survey),complete the survey quiz and then send the email request. Thank you for your help.