question archive Write an algorithm and draw a flowchart to input name and age of a person and print a eligible

Write an algorithm and draw a flowchart to input name and age of a person and print a eligible

Subject:Computer SciencePrice:2.87 Bought7

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?

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

Answer:

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

PFA

Related Questions