write an algorithm and draw a flowchart to determine whether a person can vote or not.Note. person can vote only if the age is greater 18
Answers
Answered by
1
Algorithm:
1) Start
2) Declare a variable: age
3) Take input from user;
4) if(age >= 18)
- True : Print can vote.
- else : False : Print cannot vote
5) End
Program in C++:
#include<iostream>
using namespace std;
int main()
{
int age;
cout<<"Enter age of the person : ";
cin>>age;
if(age >= 18)
{
cout<<"The person can vote";
}
else
{
cout<<"The person cannot vote";
}
return 0;
}
Attachments:
Similar questions
Math,
2 months ago
Computer Science,
2 months ago
Math,
2 months ago
Geography,
4 months ago
History,
4 months ago
Math,
11 months ago
Social Sciences,
11 months ago