#Uncomment the functions to debug them!

################# Problem 1 #########################
'''

def computeIntAverage(x, y, z):
    sum = x + y + z
    count = 3
    return sum // count
avg = computeIntAverage(5, "6", 7)
assert(avg == 6)

'''
################# Problem 2 #########################
'''

def findLineIntersect(m1, b1, m2, b2):
      x = (b2 - b1) / (m1 - m1)
      y = m1 * x + b1
      print("y coord", y)
      return x

assert(findLineIntersect(1,2,3,4) == -1.0)
assert(findLineIntersect(1, 2, 6, 8 ) == -1.2)
assert(findLineIntersect(1, 3, 6, 7) == -0.8)

'''
################# Problem 3 #########################
'''

def sayHelloOrGoodbye(leaving, name):
	if leaving == True:
		return "Hello "+ name
	else:
		return "Goodbye, "+name+", and have a great day!

assert(sayHelloOrGoodbye(True, "Frank") == "Goodbye, Frank, and have a great day!")
assert(sayHelloOrGoodbye(False, "Anagha") == "Hello Anagha")

'''
################# Problem 4 #########################
'''

import math

def apxEqual(x, y):
    return abs(x - y) < 1E-12

def circleArea(x0, y0, x1, y1):
    minRad = x_1 - x0 / 2
    maxRad = y1 - y0 / 2
    area = math.pi * minRad * maxRad
    return area

assert(apxEqual(circleArea(0, 0, 10, 20), 50 * math.pi))
assert(apxEqual(circleArea(100, 100, 300, 300), 10_000 * math.pi))
assert(apxEqual(circleArea(15, 10, 40, 32), 12.5 * 11 * math.pi))

'''
################# Problem 5 #########################
'''

import math
def roundDistance(x1, y1, z1, x2, y2, z2):
      dX = x2 - x1**2
      dY = (y2 - y1) ** 2
      dZ = pow(2, (z1 - z2) )
      dist = math.ceil(dX + dY + dZ) ** 0.5
      return dist

assert(roundDistance(0, 0, 0, 1, 1, 1) == 2)
assert(roundDistance(0, 1, 2, 3, 4, 5) == 6)
assert(roundDistance(2, 4, 6, 6, 4, 2) == 6)

'''
################# Functions Practice #########################

def studentGrade(numPage, studentID):
    pass
