Polar Ice

Program

 

For the project our team chose to use the programming language "Python". Some of the variables that we assumed stayed constant were that the temperature was not rising for any other reasons, humidity, population increase on earth remained steady, and there was no other human intervention in ice shrinkage. In Python def is the way to begin a section of the program and the first sections of our program does just that, they define the variables used in our project. The program that we created basically runs an equation for each year which creates data points for Co2 levels and ice volume. Each section's steps are first defined and then at the bottom of the program they begin running. After producing the data our program actually compiles the statistics into a raw text file to be able to be transformed in to a graph or more presentable way of viewing the data.

 

Here is our Python program:

def nogoals(): 

    yr = 2000 

  

    f = open("NoGoals.txt", "w") 

    

   

    while yr < 2100: 

        yr = yr + 1 

        co2 = 1.5*(yr-2000)+370 

        f.write(str(yr)) 

        f.write(" ") 

        f.write(str(co2)) 

        f.write("\n") 

        

           

        

    f.close() 

def ice(): 

    yr = 2000 

  

    f = open("ice.txt", "w") 

    

   

    temp = 0 

    while yr < 2100: 

        yr = yr + 1 

        vlme = (-500)*(yr-2000)+18000 

        f.write(str(yr)) 

        f.write(" ") 

        f.write(str(vlme)) 

        f.write("\n") 

    f.close() 

def ice2(): 

    userco2 = input("Enter Co2 in parts per million:") 

    

    eq = 54054054 

    ice2 = (userco2)*(eq) 

    

    print (ice2) 

nogoals() 

ice() 

ice2()

 

Here is a flow chart that shows how our program works:

 

 

This shows the entire Scratch interface where we built our Scratch program 

 

 

This shows our Scratch program while it is running. It is just asking how much CO2, once that is entered it will calculate size and that will be displayed. 

 

 

This shows our Scratch program. It is the part of the program that calculates the size of arctic sea ice given the CO2 amount.