OOSchool
Turtle seeing:
Object Oriented Programming: (note that the class code is at the top of the program)
Mini-Project: Maze
Note: You have to comment out the row print statement to get the column statement working. (couldn't fix it because the comments to,d me not to touch the code). See email for more information
Lists and Dictionaries - mini project
Are the buy and sell days for maximizing the total dollar profit the same as the days for maximizing the percentage of profit per day? Why or why not?
answer - No. The days of buy and sell for maximizing total profit is different from profit per day because total profit could be a large number but span over more days, leading to a smaller profit per day. However there could be a smaller total profit but span over fewer days, leading to a larger profit per day
Detection of Primes/Prime Biases
Lists and Dictionary
Dictionaries - Project 2
Dictionaries - Project 1
Dictionaries - exercises (Did not have enough time to do Ex. 5, considering it is extra-extra experience and it was optional)
List- revisited
Function decomposition:
Functions and Scope (intro to turtle)
What is the difference between generalization and encapsulation?
Encapsulation is where you organize a chunk of code that works together to produce something into a function so that it is easier to call it and repeat the same action later on in your program. This allows for better organization and in less lines of code. Generalization, is where you can make your functions, or a chunk of code that intakes data/information to produce something, more flexible by allowing it to intake different data (like different numbers) instead of the programmer hard coding data.
An example of encapsulation can be encapsulating the code to draw a "X" as well as encapsulating the code to draw a "O" in a tic tac toe program. This way, whenever the user clicks onto a grid, the program calls the function that contains either the X or O to draw it. If we didn't use encapsulation, we would be constantly coding the same pieces of code to create the X or O.
An example of generalization can be a function calculating the area of a circle given the radius. Because we used generalization, we can easily change the radius to find the area of a larger or smaller circle, making the program very adaptable.
Warm-up Analysis
Synthesis:
Hello world testing: