0% found this document useful (0 votes)
46 views4 pages

LAB 04 (Graded Lab 01) - Conditional Logic in Flowcharts Using Flowgorithm

Uploaded by

Haider S. Ahad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views4 pages

LAB 04 (Graded Lab 01) - Conditional Logic in Flowcharts Using Flowgorithm

Uploaded by

Haider S. Ahad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Unicersity of Central Punjab (UCP)

FOIT&CS - Dept. Of Software Engineering

CP103 - Introduction to Computing (ITC) - M9

LAB 04

GRADED LAB 01

Implement Conditional Logic in Flowcharts Using Flowgorithm

Objective:

To apply conditional logic in flowcharts using Flowgorithm, enhancing problem-solving skills


and preparing for conditional structures in programming.

Activities:
● Creating flowcharts using relational operators and control structures (if, if...else).
● Exercises on logical operators (AND, OR, NOT) and operator precedence.
● Developing flowcharts with nested if-else statements.

No. TASK TIME


1 Basic Conditional Flowchart to determine if a number is even or odd. 10 Minutes
2 Categorize a student’s grade based on their score. 20 Minutes
3 Design a flowchart to calculate discounts based on age and membership status. 20 Minutes
4 Determine the largest of three numbers. 20 Minutes
5 Design a Flowchart to solve a quadratic equation. 30 Minutes
6 Calculate the bonus for the employees of an organization. [Bonus] 30 Minutes
7 Calculate the monthly electricity bill based on usage and applies a surcharge if 30 Minutes
usage exceeds a certain threshold.
8 Submission 20 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 folder).
● Name the folder using the format: YourID_ITC_Lab4.zip

Submit Via:

 Upload the ZIP file on Horizon Portal in your ITC Lab course submission.
 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

Basic Conditional Flowchart to determine if a number is even or odd.

Steps:

1. Open Flowgorithm and start a new flowchart.


2. Use an Input symbol to get a number from the user.
3. Add a Decision symbol to check if the number is divisible by 2 ( number % 2 == 0).
4. Output "Even" if true; otherwise, output "Odd."

Expected Outcome: A flowchart that correctly outputs if a given number is even or odd.

Create a flowchart that categorizes a student’s grade based on their score.

Steps:

1. Input a student’s score (0–100).


2. Use nested If-Else statements to categorize scores: "Excellent" (>= 90), "Good" (70-89),
"Average" (50-69), and "Fail" (< 50).
3. Output the category based on the input score.

Expected Outcome: A flowchart that accurately categorizes the grade based on conditions.

Design a flowchart to calculate discounts based on age and membership status.

Steps:

1. Input customer age and membership status (Yes/No).


2. If age is over 60 or membership is "Yes," apply a 20% discount; otherwise, apply a 5%
discount.
3. Calculate and display the final price after the discount.

Expected Outcome: A flowchart that applies the correct discount based on conditions.

Create a flowchart to identify the largest number among three inputs.

Steps:

1. Start by creating a new flowchart in Flowgorithm.


2. Use Input symbols to get three numbers from the user, labeled as num1, num2, and
num3.

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

3. Use Decision symbols to compare the numbers:

First, check if num1 is greater than or equal to both num2 and num3.

If true, set num1 as the largest.

If false, proceed to the next check.

Check if num2 is greater than or equal to num3.

If true, set num2 as the largest.

If false, set num3 as the largest.

4. Use an Output symbol to display the largest number.

Expected Outcome: The flowchart correctly outputs the largest of the three numbers

Design a Flowchart to solve a quadratic equation.

Steps:
1. The values a, b, and c in the equation represent constant values. So 4x2 − 17x − 15 = 0
represents a quadratic equation where a = 4, b = −17, and c = −15. The roots may be
calculated by substituting the values of a, b, and c into the following two formulas:

−𝑏 + 𝑏2 −4𝑎𝑐 −𝑏 − 𝑏2 −4𝑎𝑐
𝑥1 = & 𝑥2 =
2𝑎 2𝑎

2. COMPUTE D = (B*B − 4*A*C) (Calculate the value of the discriminant) and store in D
3. IF D < 0

THEN PRINT “THE ROOTS ARE IMAGINARY” & Go to Step 7

ELSE COMPUTE SD = SQUARE-ROOT (D)

4. COMPUTE XI = (− b + SD) / 2*A


5. COMPUTE X2 = (− b − SD)/ 2*A
6. PRINT XI, X2
7. STOP

Expected Outcome: The flowchart correctly outputs the results of quadratic equation.

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 identify the largest number among three inputs.

Steps:

The following rules are used to calculate the bonus for the employees of an organization.

(i) If the pay is more than $3,000, the bonus amount is fixed, and it is equal to $300.
(ii) If the pay is more than $1,600, but less than or equal to $3,000, the bonus will be 10% of
the pay subject to a maximum of $240.
(iii) If the pay is less than or equal to $1,600, the bonus is 15% of pay, subject to a minimum
of $100.

Design a flowchart that calculates the monthly electricity bill based on usage and applies a
surcharge if usage exceeds a certain threshold.

Steps:

Input: Prompt the user to enter the total number of units (kWh) consumed.

Rate Calculation Based on Usage:


Tiered Rate Structure:
Up to 100 units: Rs. 50 per unit.
101–300 units: Rs. 75 per unit.
Above 300 units: Rs. 100 per unit.

Use nested If-Else conditions to apply the correct rate based on the number of units
consumed.

Surcharge for High Usage:


If usage exceeds 300 units, add a 15% surcharge on the total bill.
·
Calculate Total Bill:

Calculate the bill based on units and the applicable rate.

If applicable, add the surcharge to the total bill.

Output: Display the final amount to be paid.

CP103 - Introduction to Computing (ITC) - M9


Course Instructor: Mr. Haider S. Ahad & Lab Instructor: Ms. Iqra Javed ④

You might also like