3. Write an algorithm to find a valid voter.
Answers
Answered by
4
By 'voter', I assume the person to be a valid voter who has a voter ID, and who is equal to or above 18 years of age.
So, here's the algorithm:
1) Accept the age of the person
2) Check if it is greater than or equal to 18
3) If Age≥18, then ask if the person has voter ID. If Age<18, terminate algorithm.
4) If person has voter ID, then he is a valid voter. Otherwise he is not a valid voter.
Hope it helps.
So, here's the algorithm:
1) Accept the age of the person
2) Check if it is greater than or equal to 18
3) If Age≥18, then ask if the person has voter ID. If Age<18, terminate algorithm.
4) If person has voter ID, then he is a valid voter. Otherwise he is not a valid voter.
Hope it helps.
Similar questions