I have a question that i have to solve and that is to create a program that will calculate the surface are of somebodies body, then to calculate how much sunscreen they will need to cover their entire body using functions. This is what i have so far but i am ver lost and confused into what i need to do to get this program to work. can anyone help?
Thankyou

'''program to determine a persons surface area'''
def main():
height = float (raw_input ("How tall are you (cms?) ? "))
weight = float (raw_input ("How much do you weigh (kgs) ? "))
surfaceArea = (weight*o.423**height*0.725)0.007184
print "Your surafce area is %0.3f sq metres" % surfaceArea
main()

You just need to now how much lotion you need sy square centimeter and apply to that surface.

But first, what is suposed that number to do?

def main():
    '''program to determine a persons surface area'''

    height = float (raw_input ("How tall are you (cms?) ? "))
    weight = float (raw_input ("How much do you weigh (kgs) ? "))
    surfaceArea = (weight*o.423**height*0.725)[B]0.007184[/B]
    print "Your surafce area is %0.3f sq metres" % surfaceArea

main()

i looked up the formula to calculate surface are of a body and that was the formula it said to use. It could be very wrong.. can u help.. im struggling big time with this one

surfaceArea = 0.007184 * (weight ** .425) * (height ** .725)

If the weight is kg and the height in cm, your surfaceArea wil be in square meters.

Cheers and Happy coding

This article has been dead for over six months. Start a new discussion instead.