print("Welcome to my blog.")

Welcome to my first Computer Science action project. So far, this class has been really fun. I already learned a bit of coding languages for Python, got to make some cool code-based stuff, and know what I am doing most of all. I always tried getting into coding and never really understood what I had to do, but this class helped me with that. I only know the basics so far, like printing, variables, calculations, and more. However, with my knowledge of these things, I can still make some pretty cool stuff. My teacher for this class provided me and my classmates with some tools to try out our skills in making something the user can interact with. These tools are called codeskulptor and trinket.io. Basically, what you do with them is type in some Python code, and they will have an interactable screen which displays what you made with your code. Using trinket.io, I made a few things you can try out  for yourself down below. I hope you enjoy!

First off, we have the compounding interest calculator. I did have the option to display the code next to it, but then you would have the option to change everything. Instead, the code is below the calculator if you are curious.


Code:
name = input("What is your name?")
print("Hello " + name)
num = int(input("Please enter the principle amount."))
num2 = float(input("Please enter the compounding interest rate in decimal form."))
num3 = int(input("Please enter the amount of times the interest is compounded per year."))
num4 = int(input("Please enter the number of years."))
print("Alright. I will now make a compunding interest formula with the numbers you gave me.")
print("$" + str(num) + " x ((1+(" + str(num2) + " / " + str(num3) + "))^(" + str(num3) + " x " + str(num4) + "))")
import math
print("The total value of this equation is $" + str(num*((1+(num2/num3))**(num3*num4))))

Next, we have the letter template. It is basically like a mad libs, but for a letter you can send to someone.


Code:
print("Dear ___,\n""\nMy name is ___ ___. I am ___ years old and am from ___. The issue I care about the most is ___. I care about it so much because ___. If I could, I would solve it by ___.\n""\nSincerely, ___ ___")
print("\n")
name = input("What is your name?")
name2 = input("What is your last name?")
age = int(input("How old are you?"))
location = input("What state or country are you from?")
issue = input("What issue do you care most about?")
issuept2 = input("Why do you care so much about this issue?")
solution = input("If you could, how would you solve it?")
name3 = input("Who do you want to send this letter to?")
print("\n")
print("Dear " + name3 + ",\n""\nMy name is " + name + " " + name2 + ". I am " + str(age) + " years old and am from " + location + ". The issue I care about the most is " + issue + ". I care about it so much because " + issuept2 + ". If I could, I would solve it by " + solution + ".\n""\nSincerely, " + name + " " + name2)

I am really proud of how these things turned out. Compared to all of the other things that can be done through coding, this isn't much. But for a beginner like me, I feel very accomplished with this. I tested the calculator out by using the same formula on a regular calculator and they both got the same answer. If you ever want a shortcut to finding the answer to this equation, you can use this. Coding is tough, but the path to learning it shouldn't be when you are taking the right steps. You just need to be taught it the right way and you will get the hang of it. Once you do, you will have so much fun making things like this and feel a sense of achievement. If something isn't working, like these did when I was making them, you just need to play around with their code until you get it right. It is all about perseverance and not straying too far away from what you know. I hope you enjoyed!

Comments

Popular posts from this blog

FedEc(osystem)

"I drink you need some water..."

Deserted