# Ryan Martin
# macid: abcd123
# student number: #######
# July 12, 2011
#
# This is a solution for Marked Assignment 1 (Lab 03) on Tuesday.

import math

def main():

    print """\

This program is a solution to Marked Assignment 1 (Lab 03) on Tuesday.

"""

    #INPUTS
    L = input("Enter a value for the object's luminosity, L: ")
    R = input("Enter a value for the object's average radius, R: ")
    print

    STEFANCONSTANT = 5.67e-8

    #CALCULATION
    A = pow( L / ( 4 * math.pi * R**2 * STEFANCONSTANT ), 0.25 )
    B = pow( L / ( 4 * math.pi * (2*R)**2 * STEFANCONSTANT ), 0.25 )
    C = 100.0 * abs((A - B) / B)

    #OUTPUT
    print "The temperature for L and R, A=", A
    print "The temperature for L and 2R, B=", B
    print "The relative difference between these values, C=", C
    print ""

main()

##Design Question
##
##Stefan's constant (sigma) is implemented as a constant in Python by
##storing the value in a variable named with all capital letters. 
##This is only a convention, since Python itself does not enforce the
##values of any variables to stay constant.
##It is up to the programmer to not change the value of
##any constants later in their program.
##
##Testing Report
##
##Test: 1
##Input: [3.84e26,6.96e8]
##Expected Output: [5775.37190108,4083.80463513,41.4213562373]
##Actual Output: [5775.37190108,4083.80463513,41.4213562373]
##Result: Pass
##
##Test: 2
##Input: [string,3.45e10]
##Expected Output: [error]
##Actual Output: [NameError]
##Result: Pass
##
##Test: 3
##Input: [-3.84e26,6.96e8]
##Expected Output: [error]
##Actual Output: [ValueError]
##Result: Pass
