Unicersity of Central Punjab (UCP)
FOIT&CS - Dept. Of Software Engineering
CP103 - Introduction to Computing (ITC) - M9
LAB 03
Learn the Basics of Flowchart Creation using Flowgorithm
Objective:
Introduce Flowgorithm, create flowcharts demonstrating variables, data types, arithmetic
operations, and input/output.
Activities:
● Introduction to Flowgorithm.
● Creating simple flowcharts to understand variables, literals, and data types.
● Exercises on using arithmetic operators and evaluating expressions.
● Creating flowcharts for basic input and output operations.
No. TASK TIME
1 Create Simple Flowcharts: Variables, Literals, and Data Types 15 Minutes
2 Flowchart for Basic Arithmetic Operations 25 Minutes
3 Flowchart to Swap Two Numbers using Temporary Variable 25 Minutes
4 Flowchart to Swap Two Numbers without Temporary Variable 30 Minutes
5 Flowchart to accept the item’s code, stock on hand, and the rate per unit of 30 Minutes
stock in a department store and display the stock value of the store
6 Flowchart to calculate the total cost of a road trip based on distance traveled 30 Minutes
and fuel consumption.
Breaks & Submission 25 Minutes
Submission Instructions:
Flowgorithm Files:
● Save your Flowgorithm flowchart files for each task for Task01.fprg
● File format should be .fprg (Flowgorithm's native file format).
Submission Format:
● Combine all Flowgorithm file into a single compressed folder (ZIP file).
● Name the folder using the format: YourID_ITC_Lab3.zip
Submit Via:
Upload the ZIP file to the course's Horizon Portal.
Submission is only allowed during the Lab hours and within the Lab.
CP103 - Introduction to Computing (ITC) - M9
Course Instructor: Mr. Haider S. Ahad & Lab Instructor: Ms. Iqra Javed ①
Unicersity of Central Punjab (UCP)
FOIT&CS - Dept. Of Software Engineering
Creating Simple Flowcharts: Variables, Literals, and Data Types
I. Declare Variables: Create a flowchart that declares three variables: name (String),
ID (string) age (Integer), height (Real)
II. Assign Values: Assign the your specific information as values to the variables:
III. Output the Values: Use the "Output" symbol to print each variable on a new line.
Steps:
i. Click on the arrow & insert "Assignment" symbol to declare each variable.
ii. Assign values directly to these variables.
iii. Use three "Output" symbols to display ID, name, age, and height
Sample Output:
Hello World. My name is Haiqa
ID: L1F24BSSE0808
Age: 22
Height: 5.5
Create Flowchart for Basic Arithmetic Operations:
Input two numbers (num1 and num2).
Perform and display:
o Sum (num1 + num2) o Quotient (num1 / num2)
o Difference (num1 - num2) o Remainder (num1 % num2)
o Product (num1 * num2)
Steps:
i. Use two "Input" symbols to collect numbers.
ii. You may use "Assignment" symbols to perform the operations.
iii. Use "Output" symbols to display results.
Sample Output:
Enter 1st number: 10
Enter 2nd number: 6
Sum: 16
Difference: 6
Product: 60
Quotient: 1.66
Remainder: 4
// Use different numbers to verify the output
CP103 - Introduction to Computing (ITC) - M9
Course Instructor: Mr. Haider S. Ahad & Lab Instructor: Ms. Iqra Javed ②
Unicersity of Central Punjab (UCP)
FOIT&CS - Dept. Of Software Engineering
Flowchart to Swap Two Numbers using Temporary Variable
Steps:
i. Use two "Input" symbols to collect numbers say NUM1 & NUM2
ii. Display Before Swap Values NUM1, NUM2
iii. Declare TEMP
iv. TEMP = NUM1
v. NUM1 = NUM2
vi. NUM2 = NUM1
Sample Output:
Enter 1st Number: 10
nd
Enter 2 Number: 6
Values before Swapping
1st Number = 10
2nd Number = 6
Values after Swapping with temporary variable
1st Number = 6
nd
2 Number = 10
Flowchart to Swap Two Numbers using Temporary Variable
Steps:
i. Use two "Input" symbols to collect numbers say NUM1 & NUM2
ii. Display Before Swap Values NUM1, NUM2
iii. NUM1 = NUM1 + NUM2
iv. NUM2 = NUM1 - NUM2
v. NUM1 = NUM1 - NUM2
Sample Output:
st
Enter 1 Number: 10
nd
Enter 2 Number: 6
Values before Swapping
1st Number = 10
nd
2 Number = 6
Values after Swapping without temporary variable
1st Number = 6
nd
2 Number = 10
CP103 - Introduction to Computing (ITC) - M9
Course Instructor: Mr. Haider S. Ahad & Lab Instructor: Ms. Iqra Javed ③
Unicersity of Central Punjab (UCP)
FOIT&CS - Dept. Of Software Engineering
Create a flowchart to accept the item’s code, stock on hand, and the rate per unit of stock in
a department store and display the stock value of the store.
The inputs required to determine the stock value of the store are the stock on hand and the
rate per unit of stock, which are multiplied together to determine the stock value. The item’s
code is used as the identification data.
Steps:
i. Input to Icode
ii. Input to soh (stock on hand)
iii. Input to rate
iv. Calculate StockValue = soh * rate
v. Output Icode with StockValue
Sample Output:
Enter Item Code: XL104
Enter Stock on Hand: 6
Enter Rate per unit stock: 50
The stock value of item with code XL104 is 300
Create a flowchart to calculate the total fuel cost of a road trip based on distance
traveled and fuel consumption. The flowchart will accept
Distance traveled (in kilometers) (Real)
Fuel consumption per kilometer (in liters per km) (Real)
Cost of fuel per liter (Real)
Display the calculated Total Fuel Cost.
Sample Output:
Enter Total Distance in km: 120
Enter Mileage: 10
Enter Fuel Price Per Litre: 250
The Total Fuel Cost is Rs. 3000
CP103 - Introduction to Computing (ITC) - M9
Course Instructor: Mr. Haider S. Ahad & Lab Instructor: Ms. Iqra Javed ④