Unformatted text preview:

MET 107FlowchartsMET 107 Flowcharts A flowchart is a tool used to graphically represent an algorithm, which is a list of steps necessary to solve a problem or perform some activity. The flowchart consists of special geometric symbols containing a phrase to describe the step. The symbols are connected by arrows which describe the flow. The more commonly used symbols are: Symbol Name Description Flowline Connects symbols and shows the flow of the algorithm logic. Terminal Used to represent the Start and the End of the steps Input/Output Descibes data to be read into the program or printed and displayed by the program. Processing Used to describe arithmetic and data-manipulation operations. Decision Used for logic or comparison operations. The outflow path depends on the answer to the yes/no question asked. Predefined Process Represents another predefined algorithm Connector Connects different flowlines Offpage Connector Connects flowlines between sheets. Arrows connecting flowchart symbols have two meanings: 1. They show the order in which the transformations are to be performed 2. They show the pathway or “flow” of given information going into a symbol and required information coming out. The most basic type of flowchart is the sequential flowchart. In this case, the flow proceeds from the beginning of the steps to the end without any branching operations. More sophisticated flowcharts make decisions which allow the program to branch depending on the outcome of an asked question. 107-Flowcharts.doc Page 1 of 3 9/6/2007EXAMPLE: Develop a flowchart for finding the area of a rectangle. The flowchart for this algorithm is: ABCDE1 TITLE: Rectangle Area Calculation23 DESCRIPTION: Computes the area of a rectangle from the length4 and width parameters which are input by the user.56 PARAMETERS: Length = 27 Height = 489 CALCULATIONS:101112 Area = Length x Height = 813F Start 107-Flowcharts.doc Page 2 of 3 9/6/2007 Get Length Get Height EXAMPLE: Develop a flowchart to sort two numbers in ascending order. Area = Length x Height Cell Formula: =D6*D7 Print Area End ABCDE1 TITLE: Two Number Sort23 DESCRIPTION: Sorts two numbers into ascending order using4 an if-block.56 PARAMETERS: X = 67Y = 489 CALCULATIONS:10 Smallest = 411 Biggest = 61213FGet the Numbers X & Y Print X, Y End Is X > Y? Print Y, X Yes No Start Cell Formula: D10: =IF(D6>D7,D7,D6) D11: =IF(D6>D7,D6,D7) Note that there are other, maybe easier, ways to do this! Can you think of one?An If-Block is a tool used to compare two things in programming. It does one set of steps if the condition specified is true, and another set of steps or nothing if the condition is false. The general structure is: IF condition THEN Step(s) if true ELSE Step(s) if false ENDIF The “else” and step(s) if false are optional. In structured programming, the ENDIF command is required to tell the computer that it has reached the end of the If-block. This command is not used in Excel. Sometimes, the ELSE commands can be another if-block. This technique is called “nested ifs.” EXAMPLE: Develop a flowchart to determine if a number is greater than, less than, or equal to another number. ABCD1 TITLE: Two Number Sort23 DESCRIPTION: Determine if a number X is greater than,4 less than, or equal to a number Y56 PARAMETERS: X = 67Y = 89 CALCULATIONS:10 Result: X < Y11E8107-Flowcharts.doc Page 3 of 3 9/6/2007 Start Get the Numbers X and Y Print “X < Y” Is X = Y? Print “EQUAL” Yes No End Is X > Y? Print “X > Y” Yes No Cell Formula: D10: =IF(D6=D7,”EQUAL”,IF(D6>D7,”X > Y”,”X <


View Full Document

PSU MET 107 - Flowcharts

Download Flowcharts
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Flowcharts and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Flowcharts 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?