# Author: Nathan Mathews-Mallia # Student ID: 220225401 # Programming Task 1 - Air Quality Calculator # This program will report the Air Quality based upon user inputs. # Determine the number of readings that user requires. while True: try: readings=int(input("Enter number of readings: ")) if readings > 0: break if readings <= 0: print("Please enter a positive integer") except ValueError: print("Please enter a number, not text") # Run while loop based upon readings requires. while readings > 0: while True: try: ozone=float(input("Amount of Ozone recorded (parts per hundred million): ")) if ozone > 0: break if ozone <= 0: print("Please enter a nonnegative number") except ValueError: print("Please enter a number, not text") while True: try: sulfur=float(input("Amount of Sulfur Dioxide recorded (parts per hundred million): ")) if sulfur > 0: break if sulfur <= 0: print("Please enter a nonnegative number") except ValueError: print("Please enter a number, not text") while True: try: particles=float(input("Amount of Particles less than 2.5 micrometers diameter recorded (micrograms per cubic meter): ")) if particles > 0: break if particles <= 0: print("Please enter a nonnegative number") except ValueError: print("Please enter a number, not text") # Initialise a list and input Pollutant values. Report the highest AQI number. lst = [] OzonePollutant = 100*(ozone/8) SulfurPollutant = 100*(sulfur/20) ParticlesPollutant = 100*(particles/25) lst.append(OzonePollutant) lst.append(SulfurPollutant) lst.append(ParticlesPollutant) print("AQI:", max(lst)) # Deduct 1 from readings variable to ensure loop ends. readings = readings - 1 Author: Nathan Mathews-Mallia Student ID: 220225401 Programming Task 1 - Air Quality Calculator This program will report the Air Quality based upon user inputs. How to run: Double click the air_quality.py file. Inpui the number of readings you would like to conduct. Make sure you use a positive value float number.