""" Prac 4, Part 1:

To begin this part, you will not write code in this file; instead, open
discount_test.py and follow the instructions there. The final task in this part
is to come back to this file and fix the bugs in the function below, but you
should not modify the code below until you have written the test cases and
achieved 5 failing and 5 passing tests, as described in the test program.
"""



def calculate_discount_percent(amount):
    """
    Calculate a bulk discount percentage (as a fraction between 0 and 1)
    based on the purchase amount. Precondition: amount is a float. 
    Requirements:
    1. If the amount is negative, the string "Purchase amount cannot be negative." is returned
    2. If amount is less than 100.00, the discount is 0%.
    3. If amount is between 100.00 (inclusive) and 500.00 (exclusive), the discount is 5%.
    4. If amount is 500.00 or more (inclusive), the discount is 10%.
    """
    if amount <= 0:
        return "Purchase amount cannot be negative."
    elif amount <= 100.00:
        return 0.0
    elif amount <= 500.00:
        return 0.5
    else: # amount >= 500.00
        return 0.10
