A program is being developed to monitor daily ozone concentration levels in ppm and calculate the bulk order cost of replacing active carbon filter units in an industrial HVAC system. It displays each ozone reading stored in an array of measurements.
1: BULK_LIMIT = 150.00
2: ozone_readings = [0.045, 0.051, 0.038, 0.062, 0.040]
3: total_filter_cost = 0.0
4: print("Daily Ozone Concentrations (ppm):")
5: for reading in ozone_readings:
6: print(str(reading) + " ppm")
7: filter_price = float(input("Enter carbon filter unit cost (0 to finish): "))
8: while filter_price != 0.0:
9: total_filter_cost = total_filter_cost + filter_price
10: filter_price = float(input("Enter carbon filter unit cost (0 to finish): "))
11: if total_filter_cost > BULK_LIMIT:
12: discount_rate = 0.12
13: else:
14: discount_rate = 0.04
15: final_cost = total_filter_cost * (1.0 - discount_rate)
16: print("Total cost after bulk discount: £" + str(final_cost))
Identify the code features requested below from the program snippet shown above:
Name of a constant used in the program
Name of an array used in the program
Line number of an initialisation of a variable with a real number
Line numbers for a selection construct
Line numbers for a repetition construct (condition-controlled loop)
Line numbers for an iteration construct (count-controlled/collection loop)
Line number for an instruction that outputs information to the screen