Computer Science, asked by AratrikaMukhraiya, 10 months ago

write an algorithm and draw a flowchart to input name and age of a person and print a eligible. If age>18else print Not Eligible along with name

Answers

Answered by poojan
23

Algorithm :

Algorithm is the step by step process of the execution of code. It is just like blue print before going to coding process.

Steps of Algorithm:

  1. Start.
  2. Using an input function, ask the user to input the name and then store the value entered into a string variable.
  3. Again, using the input function, ask the user to input the age of the person, and store it in an integer variable.
  4. Write an if conditonal statement, with a condition to check whether the age inputted is greater than 18 or not.
  5. If the condition is True, print '[Person name] is Eligible'.
  6. Else, print '[Person name] is Not Eligible'.
  7. End.

Flowchart :

Graphical representation of algorithm is called a Flowchart.

Have a look at the Attachment given below.

Sample program using python language :

name = str(input("Enter the name of the person : "))

age = int(input("Enter the age of the person : "))

if age>18 :

 print(name, " is Eligible")

else:

 print(name, " is Not Eligible")

Input 1 :

Enter the name of the person : Ram

Enter the age of the person : 22

Output 1 :

Ram is Eligible

Input 2 :

Enter the name of the person : Lakshman

Enter the age of the person : 17

Output 2 :

Lakshman is Not Eligible

Learn more :

1. Program to perform Arithmetic operations using function.

brainly.in/question/18905944

2. Write a simple python function to increase the value of any number by a constant "C=5"

brainly.in/question/16322662

3. What is the output of the following snippet?

s=0

for s in range(5):

print(s)

brainly.in/question/8107653

Attachments:
Similar questions