write an algorithm and draw a flowchart to input name and age of a person and print eligible. If age >=18 else print Not Eligible along with name
Guys please help
Answers
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 :
- Start.
- Using an input function, ask the user to input the name and then store the value entered into a string variable.
- Again, using the input function, ask the user to input the age of the person, and store it in an integer variable.
- Write an if conditonal statement, with a condition to check whether the age inputted is greater than or equal to 18 or not.
- If the condition is True, print '[Person name] is Eligible'.
- Else, print '[Person name] is Not Eligible'.
- End.
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)
https://brainly.in/question/8107653