Draw a flow chart to deter mine the age of persons eligible to vote
Answers
Answer:
For this challenge you are going to code a script to ask a user how old they are and inform them as to whether they are old enough to vote or not. If they are not old enough to vote, the script will calculate how many years the user will have to wait before being allowed to vote.
Flowchart

Task #1
Recreate this flowchart by writing the pseudo-code of this algorithm using code2flow.com.
Task #2
Implement this code using Python.
Task #3
Test your code. Is it behaving the way you would expect? What input data could you use to test your code?
Test #Input ValuesExpected OutputActual Output#1Age: 21You can vote#2Age: 16You will be able to vote in 2 years.#3Age: 100You can vote.#4Age: 0You will be able to vote in 18 years.#5Age: 18You can vote#6Age: (leave blank)Error Message#7Age: “I am fifteen years old”Error Message
Task #4: Improve your code
How could you improve your code to fix some of the errors you have spotted by completing your test plan? What validation routines could you add to this code to make it more robust?


Other challenges you may enjoy...
Yes or No!
Pizza Robot – Flowchart
Flowchart to Python Code – Star Rating Validation
My daily routine
‹ Pizza Robot – Flowchart
Hogwarts Sorting Hat Challenge ›
Tagged with: Flowchart, Selection
Explanation:
NO ONE FOLLOW ME TILL NOW SO PLEASE