Question
For this assignment, I will provide most of the code. You'll need to write only one line. The program asks the user a series of
For this assignment, I will provide most of the code. You'll need to write only one line. The program asks the user a series of questions to determine whether they are qualified to vote. You will provide the code that determines, based on their answers, if they have the qualifications.
To register to vote in the State of Alabama, an individual must meet the following qualifications:
- Be a United States Citizen
- Reside in Alabama
- Be at least 18 years old
- Have not been convicted of a disqualifying felony (or have rights restored)
- Have not been legally declared "mentally incompetent" by a court
Copy this code into the IDLE editor and supply the missing line. Test and debug. Then upload your program.
votingAge = int(input("What is your age? ")) citizen = input("Are you a US citizen (Y/N)") resident = input("Are you an Alabama resident (Y/N)") felon = input("Have you been convicted of a disqualifying felony (Y/N)") competent = input("Are you mentally competent? (Y/N)") if votingAge >= 18: # updated 2/1/2022 1:40 PM votingAge = True else: votingAge = False if citizen.upper() == 'Y': citizen = True else: citizen = False if resident.upper() == 'Y': resident = True else: resident = False if felon.upper() == 'Y': felon = True else: felon = False if competent.upper() == 'Y': competent = True else: competent = False # You provide this missing line of code here print('Yes, you are qualified to vote') else: print('Sorry, you are not qualified to vote')
Extra credit: When the responses result in non-qualification, provide some logic and print statements explaining which qualifications are missing.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started