PSG COLLEGE OF
TECHNOLOGY
FLOWGARITHM
PROJECT-2
COMPUTATIONAL THINKING
ROLL NO : 24Z368
CLASS : CSE-G2
EXP NO : 1 ALGORITHM AND FLOW CHART
TITLE : DISPLAY WHETHER AGE ABOVE 18 IS ELIGIBLE
OBJECTIVE :
To create a flow chart that display the person those who above the age of 18
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets age from the user and check if
the age of the person is above 18 and display they are eligible for voting
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare a new variable and get the value of age from the user using input
function
3. Using if condition check whether the given age is greater than or equal to 18
4. If it is true , then display you are eligible for voting
5. If it is false , then display you are not eligible for voting
6. End the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 2 ALGORITHM AND FLOW CHART
TITLE : DISPLAY THE NUMBERS FROM 1 TO 10
OBJECTIVE :
To create a flow chart that display the numbers from 1 to 10 using for loop
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that display the series of numbers from 1
to 10 using for loop and display it using output function
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flowchart
2. Declare the variable x and using for loop set the range of the x values from 1
to 10
3. Then display the value of x for every iteration using output function
4. End the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 3 ALGORITHM AND FLOW CHART
TITLE : REPEATEDLY ASK FOR POSITIVE AND DISPLAY ERROR IF IT IS NEGATIVE
OBJECTIVE :
To create a flow chart that repeatedly get the positive numbers from the
users and display error when negative number is entered
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets the numbers from the user
using input and loop function repeatedly and display error message if the user
enters the negative numbers
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the variable x and assign the value of x as 0
3. Give the condition as x<2 in for loop for continuous execution
4. Declare the another variable y and get the value of y from the user using
input function
5. Give the condition y<0 in the if else statement
6. If the condition is true , then display the given number is wrong and it is
negative
7. if the condition is false , the loop continues without an end
8. end the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 4 ALGORITHM AND FLOW CHART
TITLE : ACCEPT FIVE NUMBERS AND STORE IN AN ARRAY AND DISPLAY REVERSE
OBJECTIVE :
To create a flow chart that accepts five numbers and sort them in an array
and display the numbers in reverse order
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that accepts five numbers from the user
using input function,and sorts them in an array by declaring a new array
variable,and then display the numbers in reverse order
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare a new array arr and declare new variable w and num
3. Assign the value of w as 0
4. Set the values of w from 0 to 4 using the for loop
5. Inside the for loop get the value of num from the user using input function
and then assign it on the array variable arr as per the index with reference to
w for every iteration
6. Declare new variable g , y and rand an array variable ass and assign the value
of g as 4
7. Set the same range for the second loop as per first loop and assign r as
ass[w] and assign ass[g]=r and decrease the value of g for every iteration
8. End the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 5 ALGORITHM AND FLOW CHART
TITLE : ACCEPT THE GRADE AND DISPLAY MESSAGE ACCORDING TO THE GRADE
OBJECTIVE :
To create a flow chart that accepts grade from the user and display the
message according to the grade
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that accepts the user’s grade(A,B,C,D,F)
and then display the corresponding message (e.g: “excellent” for A and so on)
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flowchart
2. Declare the string x and get the value of string from the user using input
function
3. And use if else statement with condition x=A if its true , then display your
grade is excellent
4. If it is false , then check x=B if its true then display your grade is good
5. If it is false , then check x=C if its true then display you are pass
6. If it is false , then check x=D if its true then display you mark is fair
7. If its false , then check x=F if its true then display sorry you are fail
8. If its false , end the flowchart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 6 ALGORITHM AND FLOW CHART
TITLE : TAKE TWO NUMBERS AS INPUT AND DO CALCULATION AS PER USER WISH
OBJECTIVE :
To create a flow chart that takes two numbers from the user and do
mathematic calculation as per user’s choice
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that takes two values from the user
using input function and do mathematical calculation (addition,
subtraction,multiplication,division) as per the user’s choice and display the result
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare three variables x , y and r
3. Get the values of x and y using the input function from the user and declare c
as string and get c from user as choice
4. If choice is add then add x and y
5. If it is false , checks c is subtract if it is true then subtract x and y
6. If it is false , checks c is multiply if it is true then multiply x and y
7. If it is false , checks c is divide if it is true then divide x and y
8. If it is false , end the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 7 ALGORITHM AND FLOW CHART
TITLE : CHANGE CELUSIUS TO FARENHEIT AND VICE VERSA . AS PER THE CHOICE
OF THE USER.
OBJECTIVE :
To create a flow chart that converts the temperature from Celsius to
Fahrenheit and vice versa as per the choice of the user.
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets the temperature from the user
and calculates from c to f and f to c as per the choice of the user and display the
Celsius or Fahrenheit as per the choice using the output function.
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the integer c and f
3. Display the choice using output function as f to c or c to f
4. Declare the string s and get the choice from the user to s using input
function
5. if s = c to f is true , then get the celsius from the user and convert the Celsius
to Fahrenheit using formula and then assign it to the f and display the f using
the output function
6. if s= c to f is false , then get the Fahrenheit from the user and convert the
Fahrenheit to Celsius using formula and then assign it to the c and display
the value of c using the output function
7. end the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 8 ALGORITHM AND FLOW CHART
TITLE : MULTIPLICATION TABLE FOR GIVEN NUMBER
OBJECTIVE :
To create a flow chart that display the multiplication for the given number
from the user
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that takes the value of the multiplication
table to be created from the user using input function and display the
multiplication table by using the for loop
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the integer x and y and get the number to be displayed as a
multiplication table by y
3. Using for loop set the range of the multiply table to be displayed
4. Inside the loop display the multiply of x and y for every iteration
5. End the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 9 ALGORITHM AND FLOW CHART
TITLE : CHECK WHETHER THE GIVEN YEAR IS LEAP YEAR OR NOT
OBJECTIVE :
To create a flow chart that display whether the given year is leap year or not
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets the year from the user using
input function and check whether it is leap year or not a leap year using the if else
statement and display according to the condition
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the variable y and get the year from the user using input function
with the variable y
3. Check the condition y%4=0 using if else statement
4. If it is true , then display it is a leap year
5. If it is false , then display it is not a leap year
6. End the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 10 ALGORITHM AND FLOW CHART
TITLE : TAKE THREE NUMBERS AND CALUCULATE AVERAGE AND PRINT THE RESULT
OBJECTIVE :
To create a flow chart that display the average of three numbers and display
the average of three numbers
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets three integer from the user
using the input function and then it calculates the average by adding the three
numbers and divide it by three and then it display the average using the output
function
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the three integers x , y , z and avg
3. Get he values of the x y and z using the input function from the user
4. Assigns the value of avg by adding the x y and z and divide it by 3
5. Display the value of avg using output function
6. End of the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 11 ALGORITHM AND FLOW CHART
TITLE : ASK FOR A NUMBER FROM USER AND CHECK IF IT IS DIVISIBLE BY 5
OBJECTIVE :
To create a flow chart that ask a number and check whether it is divisible by
5 or not
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets number from the user using
input function and it checks the given number is divisible by five or not
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start of the flow chart
2. Declare the variable x and get the value of the x from the user using the input
function
3. Check the condition x%5=0 , if it is true , then display the given number is
divisible by 5
4. If the condition is false , then display the given number is not divisible by 5
5. End of the flow chart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 12 ALGORITHM AND FLOW CHART
TITLE : CONERTS THE GIVEN NUMBER OF HOURS INTO MINUTES
OBJECTIVE :
To create a flow chart that converts the given number of hours into minutes
and display the result
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm that gets the hours from the user and
convert the hours into minutes and display the converted value by using the output
function
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the variable x and y
3. Get the value of hours from the user using the input function by x
4. Assign the variable y as x*60 to convert hours into minutes
5. Display the value of y by using the output function
6. End of the flowchart
FLOWCHART DIAGRAM :
OUTPUT :
EXP NO : 13 ALGORITHM AND FLOW CHART
TITLE : CHECKS IF THE GIVEN NUMBER IS PRIME NUMBER
OBJECTIVE :
To create a flow chart that display whether the given number is prime
number
PROBLEM STATEMENT :
Design a flowchart in a flowgarithm gets the number from the user using the
input function and checks the given number is prime or not and display the result
TOOLS USED :
• SOFTWARE : FLOWGARITHM
APPROACH :
1. Start the flow chart
2. Declare the integer A B and C
3. Get the number from the user using the input function to the variable A
4. Give the range B=2 to A-1 in the for loop
5. Assign C=A%B and then give the condition c=0 in the if else statement
6. If its true , then displays the given number is not a prime number and break
the loop
7. If it is false , then the loop continues until the last value reaches if all the
values are false then after the loop it displays the given number is a prime
number
FLOWCHART DIAGRAM :
OUTPUT :