Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Computer ProgrammingPROBLEM 1 CSC 1 2 1 - Lab 0 2 D:ICSC 1 2 1 CSC 1 2 1 . 0 0 5

Computer ProgrammingPROBLEM 1 CSC121-Lab02 D:ICSC121\CSC121.005\CSC121-Lab02
> Screenshots
Lab02P1.py
Lab02P2.py
> External Libraries
Scratches and Consoles
if aqi 50
Run Lab02P1
C :
C: \Users \Jimmy \AppData\Local\Programs\Python \Python311\python.exe D:\CSC121\CSC121.005\CSC121-Lab02\
Lab02P1.py
Enter the Air Quality Index (AQI): 152
Unhealthy for Sensitive Groups
Process finished with exit code
In this problem, you are given a completed program that has logic errors. You need to fix the errors.
This flawed program is an Air Quality Classifier. The user enters an AQI value, and the program outputs a specific health impact. Here are the classifications:
AQI Value Classification
0-50 Good
51-100 Moderate
101-150 Unhealthy for Sensitive Groups
151-200 Unhealthy
201-300 Very Unhealthy
301 or more Hazardous
The instructor has provided a file called Lab02P1-FixTheErrors.py. Download that file and rename it Lab02P1.py.
Copy that file into your PyCharm project.
Change the program header to include your name and the date.
Run the program AS IS and see if you can determine what is wrong with the program.
Take a screenshot of the program running that demonstrates an error and name the screenshot Lab02P1-error.jpg.
HINT: Try using the AQI value of 100 or 200 and see how those are incorrectly classified. To make sure you have the program completely correct, test all BOUNDARY CONDITIONS.
Review the code and correct all the errors. You should eventually be able to run the program that accurately classifies the ages with no errors.
NOTE: PyCharm may give you a hint to "Simplify chained comparison" with a yellow underline. That suggestion can be safely ignored.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions