Lab05 - Iterative Solution - For Loop
Lab05 - Iterative Solution - For Loop
LAB 05
Objective:
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:
Create a flowchart to calculate and print the sum of the first N natural numbers (e.g., 1 + 2
+ 3 + ... + N).
Create a flowchart that prints all odd numbers between two given values, Num1 & Num2.
Design a flowchart that generates the multiplication table for a given number up to a
specified range.
Example Output:
4*1=4
4*2=8
4 * 3 = 12
4 * 4 = 16
4 * 5 = 20
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 Output:
4
3
2
1
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:
Example Output:
Total Calories = 1000
“Well Done , You are within your calorie goal!"