This Python program collects survey data on how well teacher salaries align with the cost of living in different states. Participants provide their age, state abbreviation, and opinions on teacher salaries through a series of validated inputs.
Age Validation – Ensures the user enters a two-digit number (10-99).
State Validation – Accepts only valid two-letter U.S. state abbreviations.
Salary Rating – Asks users to rate salary alignment on a scale from 1 to 5 and converts it into an opinion.
Fair Starting Salary Input – Ensures users enter a positive number.
Multiple-Choice Questions – Collects opinions on funding sources and salary adjustments with validated responses.
Data Storage – Displays valid responses and outputs them in CSV format for further analysis.
age_input (str) – User input for age.
age (str/int) – Two-digit age value (if valid).
state_input (str) – User input for the two-letter state abbreviation.
salary_rating_input (str) – User input for the 1-5 rating scale.
salary_rating (int) – Converted rating
salary_input (str) – User input for suggested teacher salary.
salary (int) – Converted salary.
choice_1 (str) – User response to the funding source multiple-choice question.
choice_2 (str) – User response to the salary adjustment multiple-choice question.
current_date (str) – The timestamp of the survey submission
Valid Inputs
Displays the cleaned and formatted user responses.
Outputs data in a structured CSV format:
Invalid Inputs:
Displays error messages for incorrect or missing inputs.
If any input is invalid, the final CSV output is not generated.