Top Banner
Program Design BUILDING A HOUSE
10

Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Dec 14, 2015

Download

Documents

Audrey Dawson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Program DesignBUILDING A HOUSE

Page 2: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.
Page 3: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Steps to Designing a Program

1.Define the Output2.Develop the logic to get that

output3.Write the program

Page 4: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Define the Output

The output is the last thing produced but is the first thing designed.

You wouldn’t build a house without first knowing what you want it to look like.

We will focus on using a top down approach

Page 5: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Top Down Design

Don’t get caught up in the details!1. Determine the overall goal.

2. Break that goal into two, three or more detailed parts. Too many more details may cause you to leave things out.

3. Put off details as long as possible. Keep repeating steps 1 and 2 until you cannot reasonably break things down any further.

Page 6: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.
Page 7: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Develop the Logic

Output definition describes what the program is supposed to do.

Developing the logic is where you must decide how it will do that.

Two different options: Flowcharts Pseudocode

Page 8: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Flowcharts

Some basic rules:

1. The logic should flow from the top of the page to the bottom and from left to right.

2. Use basic symbols like Squares for basic processes, Diamonds for Decisions, Small circles for loops and connectors, Arrows for direction of flow, and Parallelograms for Input/Output such as asking the user a question or printing a report.

3. Decision symbols are the only symbols that can have more than one exit point.

4. A decision symbol should always ask a yes or no question. Example: Are you over 50? Vs How old are you?

5. Write your instructions inside the symbols in clear, plain English.

Page 9: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Pseudocode

Pseudocode is a method of writing logic using sentences instead of the diagrams of flowcharting.

Pseudocode doesn’t have any programming statements but is not free flowing English statements.

Page 10: Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.

Finally, Write the Program