Write a function that will find the cost to send an international fax. The service charge is $7.00. It costs $0.45 per page for the first ten pages and $0.10 for each additional page. Take as parameter the number of pages to be faxed, and calculate the total amount due. The total amount due is returned to the main program.

Respuesta :

Answer:

This function is written in python

def intlfax(pages):

    if pages <=10:

         fax = 7 + 0.45 * pages

    else:

         fax = 7 + 0.45 * 10 + 0.10 * (pages - 10)

    return fax

Explanation:

This line defines the function

def intlfax(pages):

This checks if pages is less than or equal to 10 and calculates the fax

    if pages <=10:

         fax = 7 + 0.45 * pages

If otherwise, it also calculates the fax (differently)

    else:

         fax = 7 + 0.45 * 10 + 0.10 * (pages - 10)

This returns the calculated fax

    return fax