Question: Your program begins with a configuration step in which the user is prompted to input two values. The values are read in one time, and

Your program begins with a configuration step in which the user is prompted to input two values. The
values are read in one time, and are fixed for the remaining duration of the program. That is, all the
sample sets are processed using the same configuration.
1. First, prompt for the threat level threshold (min_threat_level) to determine whether a
packet is threatening. The min_threat_level is an integer and its value must be equal to
or larger than the constant MINTHRESH. If the input value is invalid (Examples of invalid input
are hello,5.4,-2, etc.), print a message (The minimum level is
invalid.) and repeat the request for the threat level threshold until a valid value is entered.
However, if the value is -1, then exit your program instead (by calling sys.exit()).
2. Next, prompt for the false alarm threshold value (false_alarm_count). The
false_alarm_count must be a positive integer, and again prompt until a valid value or a -1
is input.
Note that min_threat_level and false_alarm_count are defined in the given template with
negative initial values. They both are expected to change during the configuration step according to the
users input.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!