Presentation is loading. Please wait.

Presentation is loading. Please wait.

Program Flowchart Design tool commonly used in designing input, output and process flow of a program A graphical representation of the program logic using.

Similar presentations


Presentation on theme: "Program Flowchart Design tool commonly used in designing input, output and process flow of a program A graphical representation of the program logic using."— Presentation transcript:

1 Program Flowchart Design tool commonly used in designing input, output and process flow of a program A graphical representation of the program logic using standard symbols Using three primary program constructs; sequence, selection and iteration/repetition

2 Three Program Constructs in Flowchart
Sequence Each instruction is executed in a serial manner, one after another Selection Provide a decision point that allows one of two choices to be chosen

3 Three Program Constructs in Flowchart
Iteration Repeat a set of instructions a number of times based on condition stated. This loop will end when condition has been fulfilled

4 Symbols Used in Program Flow Chart
Processing Program flow Decision Terminal Connector Input/Output

5 Guidelines in flowchart
In drawing a proper flowchart, all necessary requirements should be listed out in logical order. The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity in understanding the flowchart.

6 Guidelines in flowchart
The usual direction of the flow of a procedure or system is from left to right or top to bottom. Only one flow line should come out from a process symbol.

7 Guidelines in flowchart
Only one flow line should enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol.

8 Guidelines in flowchart
Only one flow line is used in conjunction with terminal symbol. Ensure that the flowchart has a logical start and finish.

9 Guidelines in flowchart
If the flowchart becomes complex, it is better to use connector symbols to reduce the number of flow lines. Avoid the intersection of flow lines if you want to make it more effective and better way of communication.   It is useful to test the validity of the flowchart by passing through it with a simple test data.

10 answer = number1 / number2
Sequence Example: Start Get number1 answer = number1 / number2 Stop Get number2 Display answer

11 Problem: Prepare a flowchart that would tell the user to input 5 numbers. Compute the total of the number and display the result.

12 Problem: Given the radius of a circle equal to 5 inches, prepare a flowchart that will calculate and print its area. Use the formula: 𝐴=𝜋 𝑟 2

13 Problem: Prepare a flowchart that would tell the user to input the price and the tax of a particular item. Compute and display the sales tax.

14 Problem: Prepare a flowchart that reads in a radius of a circle and then calculate the area using the formula: 𝐴=𝜋 𝑟 2

15 Problem: Prepare a flowchart that will allow the user to input the cost of an item, compute for its discount of 25%, and print the discount and the discounted value.

16 Problem: Prepare a flowchart that will compute the exchange rate to US dollar to the Philippine Peso. 1 US dollar = P 60.48 Display the equivalent peso value.

17 Problem: Prepare a flowchart that will compute the exchange rate to US dollar to the Philippine Peso. 1 US dollar = P 60.48 Display the equivalent peso value.

18 Problem: Monthly cable charge is a flat rate of P 2, Prepare a flowchart that will determine the total cost given user inputs the number of months. Use the formula: Total cost = cable charge x no. of months

19 Problem: Prepare a flowchart that will allow the user to input the gross sales, expense and cost of goods being purchased. Compute the profit of a company using the formula. Profit = gross sales – expense cost of goods

20 Selection Example 1 Start Get number1 Get number2 yes number2= 0?
answer = number1 / number2 Display answer Stop Display "Division by zero error"

21 Selection Example 2 Display main menu Start Get choice choice =1?
Stop Display "choice 1 selected" Display "choice 2 selected" Display "choice 3 selected" Display "choice 4 selected" no yes

22 Iteration Example 1 Start total = 0 Get number no number < 1000?
total = total + number2 Stop total = 0 yes Display total Get number

23 Iteration Example 2 Start i = 1 no i <= 12? Stop yes result = i * 9
Display (i, "*9=",result) i = i + 1

24 Connector Example A program to accept input of a series of numbers and total up value entered until ‘0’ is entered. Then display number of data entered and total

25 Exercises Draw a flowchart for a program that accepts an amount entered through the keyboard. Then, determine the discount rate allowed; 20% would be given to any purchase of more than $1000, 10% to purchase of more than $500 (inclusive). Display the discount given and also the amount after the deduction of the discount. Draw a flowchart for a program which prompt the user to enter his/her name & age and determine whether he/she is an adult or not. If he/she is below 20 years old the user would be a teenager else he/she would be an adult. The user will be prompted after each person, if he/she wishes to enter anymore names. The program continues to run until the user enters ‘NO’ or ‘N’.


Download ppt "Program Flowchart Design tool commonly used in designing input, output and process flow of a program A graphical representation of the program logic using."

Similar presentations


Ads by Google