Discounts ========== #. A shop offers a discount of 5€ if the total amount of the purchase, including VAT, is more than 50€. Write the function :py:func:`discount1` that given the amount of the purchase (without VAT) and the VAT percentage to be applied (``float``), returns the total amount to pay (``float``). Save this function into a file named :file:`discount1.py`. Examples: .. literalinclude:: discount1.txt :language: python3 :lines: 2- .. note:: More tests are provided in the :download:`discount1.txt ` #. A shop offers a discount of 5€ if the total amount of the purchase, including VAT, is more than 100€ and a discount of 2€ if the purchase is lower or equal to 100€. Write the function :py:func:`discount2` that given the amount of money of the purchase (without VAT) and the VAT to be applied (``float``), returns the total amount to pay (``float``). Suppose that the purchase is always higher than 2€. Save this function into a file named :file:`discount2.py`. Examples: .. literalinclude:: discount2.txt :language: python3 :lines: 2- .. note:: More tests are provided in the :download:`discount2.txt ` #. A shop offers a discount of 5€ if the total amount of the purchase, including VAT, is more than 100€, a discount of 10€ if the purchase is higher than 150€ and a discount of 20€ if the purchase is higher than 250€. Only one discount can be applied. Write the function :py:func:`discount3` that given the amount of money of the purchase (without VAT) and the VAT to be applied (``float``), returns the total amount to pay (``float``). Save this function into a file named :file:`discount3.py`. Examples: .. literalinclude:: discount3.txt :language: python3 :lines: 2- .. note:: More tests are provided in the :download:`discount3.txt ` #. A shop offers a discount of 5€ if the total amount of the purchase, including VAT, is more than 100€. Moreover, if the client buys more than 5 units of the product, it offers an additional discount of 3€. Write the function :py:func:`discount4` that given the amount of money of the purchase (without VAT), the VAT to be applied (``float``) and the number of units bought (``int``), returns the total amount to pay (``float``).Save this function into a file named :file:`discount4.py`. Examples: .. literalinclude:: discount4.txt :language: python3 :lines: 2- .. note:: More tests are provided in the :download:`discount4.txt ` .. rubric:: Solutions A solution of these functions is provided in the :download:`discount1.py `, :download:`discount2.py `, :download:`discount3.py `, :download:`discount4.py `