0% found this document useful (0 votes)
18 views3 pages

Lab05 - Iterative Solution - For Loop

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)
18 views3 pages

Lab05 - Iterative Solution - For Loop

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/ 3

University of Central Punjab (UCP)

FOIT&CS - Dept. Of Software Engineering

CP103 - Introduction to Computing (ITC) - M9

LAB 05

Flowgorithm - Iterative Solutions [For Loop]

Objective:

Implement Loops in Flowcharts

Activities:
● Introduction to loops: For Loop.
● Creating flowcharts to demonstrate loop usage.
● Exercises on solving problems using iterative solutions.

No. TASK
1 Create a flowchart to calculate and print the sum of the first N natural numbers.
2 Create a flowchart that prints all even numbers & odd numbers between two given
values, Num1 and Num2.
3 Design a flowchart that generates the multiplication table for a given number up to a
specified range.
4 Create a flowchart to separate each digit of a given integer N
5 Daily Calorie Tracker for a Fitness App
Breaks & Submission

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 Lab 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 ①
University of Central Punjab (UCP)
FOIT&CS - Dept. Of Software Engineering

Create a flowchart to calculate and print the sum of the first N natural numbers (e.g., 1 + 2
+ 3 + ... + N).

Example Input: N = 5 Example Output: 15

Create a flowchart that prints all odd numbers between two given values, Num1 & Num2.

Example Input: Num1 = 0 & Num2 = 12

Example Output: Odd Numbers = 1,3,5,7,9,11

Design a flowchart that generates the multiplication table for a given number up to a
specified range.

Example Input: Num= 4 & Range = 5

Example Output:
4*1=4
4*2=8
4 * 3 = 12
4 * 4 = 16
4 * 5 = 20

Create a flowchart to separate each digit of a given integer N.

Steps:
i. Determine the size of digit by expression ( size = log(N) / log (10) + 1 ).
ii. Use the for loop till size.The integer used here is of base 10.
iii. Use the modulus operator (%) to print the last digit.
iv. Then use division operator ( / ) to remove the last digit from the original number N.

Example Input: N = 1234

Example Output:
4
3
2
1

CP103 - Introduction to Computing (ITC) - M9


Course Instructor: Mr. Haider S. Ahad & Lab Instructor: Ms. Iqra Javed ②
University of Central Punjab (UCP)
FOIT&CS - Dept. Of Software Engineering

Create a flowchart for a fitness app that helps users track their daily calorie intake. It
prompts the user to enter the calorie count for each meal throughout the day, one at a time,
and calculates the running total. At the end of the day, it compares the total to a daily
calorie goal and provides feedback.

Example Input:

Daily Calorie Goal = 1200


Number of Meals = 3
Calorie Count for Meal 1 = 400
Calorie Count for Meal 2 = 300
Calorie Count for Meal 3 = 200
Number of Snacks = 2
Calorie Count for Snack 1 = 50
Calorie Count for Snack 2 = 50

Example Output:
Total Calories = 1000
“Well Done , You are within your calorie goal!"

CP103 - Introduction to Computing (ITC) - M9


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

You might also like