Class 4 Reflection
In Class 4 we learned about different types of algorithms. There are selection algorithms, that make decisions based on circumstances. There are iteration algorithms, aka repitition algorithms. After performing a procedure, it can check to see if it has been completed. Other things we revisted are conditional statements, such as if else statements, which allow the program to make a decision on which code to run based off of conditions. Then, there are loops (for and while) that repeat code. Lastly, they talked about strings which is a data type that is used to represent text. I think this class was the most confusing, as they didn't quite talk much (at least in class) about what an algorithm was, and they just went straight into it.
Homework 1:
# put your work for Hack #1 in here below:
first = "Lindsay "
last = "Tang"
fullName = first + last
print("My full name is " + str(fullName))
#Part 2
sentence = "My dog ate a bee and now he needs to go to the vet."
length = len(sentence)
characters = length - 14
print(characters)
Homework 2:
# put your work for Hack #2 in here below:
num1 = 40
num2 = 4
num3 = 12
num4 = 2
answer = (num1 / num2 + num3 % num4)
print(answer)