Geeking out big time

I did it again today

I went to school 6 hours early so I could just do a bunch of programming. Im working on Python right now, I actually finished all of my homework so I am just playing around. What just I did is so cool; there was a program we had to write to calculate the interest an account accumulates over time. The challenge given to us was simple, to make the user to be able to input not only the principal and interest rate, but also how many years they want to calculate for. Simple.

I thought something was missing…

Wouldn’t it be nice if you could see the value of each year up to your final calculated year? Well I already had the years stored in a variable… so I slapped a print statement in the for loop I used to make the calculation.

It was so cool!

I first ran the module for a ten year calculation, I was so excited! I looked really nice. So nice that I wanted to see a thousand year investment…

This slideshow requires JavaScript.

My source code:

def main():
    print("This program calculates an investments value over time")
    principal = eval(input("Enter the initial principal:"))
    apr = eval(input("Enter the annual interest rate:"))
    years = eval(input("Enter how many years ahead you would like to calculate:"))

    for i in range (years):
        principal = principal * (1+apr)
        print("year" ,i+1 ,principal)

    print("The value in year",years, "will be", principal)

main()

Advertisements

Dang!

photo 1 photo 2 photo 3

School is going to be crazy this quarter. For several quarters I tackled 18 credits; this quarter…13 credits. I have never been more intimidated by my classes though, in the first week in my JavaScript class alone I have been prompted to build 4 websites! It looks like I will be busy as all hell for a while here. On the bright side I am extremely excited for all of my classes! For the first time in my web dev program I am actually producing stuff! Granted I did make websites in html previously and programs in python but now, I am actually getting to express my self and ideas in my classes and create dynamic and interesting things! My web design course has been the best so far, it feels almost like a step back to childhood. I’m not saying its easy but that its fun; its like play time for grown ups (that play with code and layouts for fun). Every day in this class we are to “sketch a web” and draw out a webpage. I do that any way! I joked with myself that instead of taking the time in class to draw one up that I would just spend that time going through my notebook to find my favorite to share. Furthermore we also search the internet for websites that we like, which comically is another thing I┬ádo often and was actually doing in class with each spare moment I could find In the learning. How amazing when the things you do for fun become “work” and/or “school”. We are even going to be making personal websites and websites in teams for a real client! Nothing easy but a lot fun. I’m excited, bring it on!