# Spencer Smith
# macid: smiths
# student number: #######
# January 23, 2011
#
# This is a solution for Major Assignment 1 (Lab 04) Version C74.

import math

print """\

This program is a solution to Major Assignment 1 (Lab 04) Version C74.

"""

sigma_m = input("Enter the maximum stress: ")
Sr = input("Enter the slenderness ratio: ")
alpha = input("Enter the alpha parameter: ")
print ""

A = sigma_m / (1 + alpha/math.cos(0.001*Sr))
print "The loading for sigma_m, Sr and alpha is =", A

B = sigma_m / (1 + 2*alpha/math.cos(0.001*Sr))
print "The loading for sigma_m, Sr and 2*alpha is =", B

C = 100 * abs((A - B) / B)
print "The relative difference between these values is =", C
print ""


# Design Question
# 
# The variables in the program are the inputs sigma_m, Sr and alpha and
# the outputs A, B and C.  Good variable names have the following
# characteristics: they are descriptive, they match the requirements,
# they are not too long, and they are not so similar to one another
# that programming errors are likely.
# 
# 
# Testing Question
# 
# Test: 1
# Input: [36000, 50, 0.1]
# Expected Output: [32723.55, 29993.74, 9.10]
#
# Test: 2
# Input: [85000, 10, 0.075]
# Expected Output: [79069.49, 73912.56, 6.98]
