Professional Documents
Culture Documents
Flowgorithm PDF
Flowgorithm PDF
SESSION #F1
Initial window displayed with basic flowchart
This is where the flowchart is defined
2
Output will be shown in a separate window called
the Console
3
Flowgorithm
4
A pop-up menu with options will be displayed
Comments can be added like this:
Flowgorithm
5
Flowgorithm
9
Flowgorithm
11
Flowgorithm
12
Flowgorithm
• When you want a user to enter data, you need to "prompt" them
• In an interactive program, prompting means displaying some text
explaining what data the user needs to enter
19
Must specify the variable name and data type
20
Read in the number with Input symbol and assign
it to the variable 21
22
Will add an output statement that displays…
23
… the user's number and some text.
Notice how text and variable names are specified
24
When run prompt shown in the console
Enter data in textfield at bottom and click Enter
25
Notice your input on right
26
Addition of two numbers
Swapping of two numbers
Looping using While
Looping using While
Looping using While
Looping using For
Looping using For
Looping using Do
Looping using Do
Factorial of a number
GCD of two numbers
Program- Cost Calculation
Compound Condition
• In Flowgorithm use AND and/or OR in the
diamond shape
39
Sum of digits
Declaring Array
Maximum in an array of
numbers
Including a Function
Function name and parameters
Function name and parameters
Function template
Function call from main when the
function does not return any value
Function call from main
52
Question 2
Program - Long Distance Charges
• Long distance charge basics:
• Company charges 10 cents per minute for all calls outside
the customer’s area code that last over 20 minutes
55
Question 4
56