
from __future__ import division
###################################################################
# Question 1
###################################################################
def f2c(t):
	return 5.0/9.0*(t - 32) #convert from f to c
###################################################################
# Question 2
###################################################################
def lboz2kg(p,o):
		a= p/2.2 #pounds convert
		b=(o/0.035274)/1000 #ounces convert
		kg=a+b #add together
		return (kg) # return in kg
###################################################################
# Question 3
###################################################################
def bibformat_mla(author,title,city,publisher,year):
	x="'%s. %s. %s: %s, %d'"%(author,title,city,publisher,year)
	return x
###################################################################
# Question 4
###################################################################
def bibformat_apa(author,title,city,publisher,year):
	y="'%s (%d). %s. %s: %s'"%(author,year,title,city,publisher)
	return y
###################################################################
# Question 5
###################################################################
def joker():
	a = raw_input("Enter your name:")
	b = " walks into a bar with a slab of asphalt under arm. Says to the bartender I'll take a beer, and one for the road"
	ab = a+b
	print ab
###################################################################
# Question 6
###################################################################
def bmi(w,h):
	height = h*h
	bmi = w/height*703
	print(bmi) 
###################################################################
# Question 7
###################################################################
def lbs2lboz(p):
	o = p % 1 * 16
	l= p-p % 1
	print (l,o)

###################################################################
# Question 8
###################################################################
def oz2lboz(oz):
	l = oz // 16
	o = oz % 16
	print (l,o)

###################################################################
# Question 9
###################################################################
def bmi_calculator():
	app = raw_input("Enter your appelation :")
	f_name = raw_input("Enter your first name :")
	l_name = raw_input("Enter your last name :")
	h = int (raw_input("Enter your height in inches:"))
	w = int (raw_input("Enter your weightin pounds :"))
	f = int(h)/12
	height = h*h
	bmi = w/height*703.0


	y = "'BMI Record for %s %s %s: '"% (app, f_name, l_name)
	print y

	print "'Subject is %d feet %d inches tall and weighs %d pounds.'"% (f, h, w)
	print "The subject's BMI is %d" % (bmi)

###################################################################
# Question 10
###################################################################
def hashes(n):
	string = '#'*n
	return string
###################################################################
# Question 11
###################################################################
def memory_size(n):
	length = len(str(n))
 	if length < 4:
  		type = "B"
  		var = 1
  		memoryval = str(round(n/var, 1))
  		print memoryval + type

	elif length < 7:
 		type = "KB"
  		var = 1000**1
  		memoryval = str(round(n/var, 1))
  		print memoryval + type

 	elif length < 10:
  		type = "MB"
  		var = 1000**2
  		memoryval = str(round(n/var, 1))
  		print memoryval + type  

 	elif length < 13:
  		type = "GB"
  		var = 1000**3
 		memoryval = str(round(n/var, 1))
 		print memoryval + type
	elif length >= 13:
		type = "TB"
		var = 1000**4
		memoryval = str(round(n/var,1))
		print memoryval + type
		########################