nazaninsaedi / Coursework-Planner

Your coursework planner
1 stars 1 forks source link

[TECH ED] What is an algorithm #47

Open nazaninsaedi opened 1 year ago

nazaninsaedi commented 1 year ago

From Course-Fundamentals created by SallyMcGrath: CodeYourFuture/Course-Fundamentals#3

Link to the coursework

https://www.youtube.com/watch?v=cDA3_5982h8

Why are we doing this?

Programming is all about algorithms. But what is an algorithm?

Read Introduction to Algorithms in the book the JS Way Watch The Exact Instructions ChallengešŸ˜„

These show "algorithm recipes", and the video shows that you have to think carefully when building them. How does CYF Blocks help you build algorithms? Discuss this together in a Slack thread.

Maximum time in hours

2

How to submit

Discuss this together in a Slack thread

nazaninsaedi commented 1 year ago

Except in very simple cases, you donā€™t create programs by writing source code directly. You'll first need to think about the instructions you'll want to convey.

Take a concrete example from everyday life: I want to make a vanilla Cake. What are the steps that will enable me to achieve my goal? Algorithm: Baking a Vanilla Cake

Gather Ingredients:

2 Ā½ cups all-purpose flour 2 Ā½ teaspoons baking powder Ā½ teaspoon salt 1 Ā¼ cups granulated sugar Ā½ cup unsalted butter (softened) 3 large eggs 1 teaspoon vanilla extract 1 cup milk Preheat Oven:

Preheat the oven to 350Ā°F (175Ā°C). Prepare the cake pans by greasing and flouring them. Combine Dry Ingredients:

In a bowl, whisk together the flour, baking powder, and salt. Set aside. Cream Butter and Sugar:

In a separate large bowl, cream together the softened butter and granulated sugar until the mixture is light and fluffy. Add Eggs and Vanilla:

Add the eggs one at a time, mixing well after each addition. Then, mix in the vanilla extract. Alternate Adding Ingredients:

Gradually add the dry ingredients and milk to the butter mixture, beginning and ending with the dry ingredients. Mix until just combined. Pour Batter into Pans:

Divide the batter evenly between the prepared cake pans, smoothing the tops with a spatula. Bake:

Place the pans in the preheated oven and bake for approximately 25-30 minutes, or until a toothpick inserted into the center of the cakes comes out clean. Cool:

Remove the cakes from the oven and allow them to cool in the pans for about 10 minutes. Then, remove the cakes from the pans and let them cool completely on wire racks. Frost and Assemble:

Once the cakes are completely cool, you can frost and assemble the cake with your choice of frosting or filling. Enjoy: Slice and serve the delicious vanilla cake! This algorithm outlines the step-by-step process of baking a vanilla cake. Each step is clear and unambiguous, guiding you through the process from gathering ingredients to enjoying the final product. This is a simple example of how algorithms provide a structured approach to solving a specific problemā€”in this case, baking a cakeā€”in a logical and organised manner.

nazaninsaedi commented 1 year ago

CYF Blocks provides an intuitive drag-and-drop interface, resembling the joy of assembling a puzzle and reminiscent of the carefree exploration of childhood. This method is especially beneficial for newcomers, like myself, fostering a welcoming space for hands-on experimentation. Here, the process of trial and error becomes an integral part of the learning adventure, nurturing growth through both achievements and setbacks along the way.

nazaninsaedi commented 1 year ago

Image

nazaninsaedi commented 1 year ago

WHAT DOES AN ALGORITHM TASK ENTAIL? In what ways does CYF Blocks assist in algorithm construction? 1- Boasting user-friendly simplicity, it employs a drag-and-drop interface that particularly appeals to novices, fostering a more intuitive approach to algorithmic development. 2- Complex algorithms are deconstructed into more manageable, discrete steps. Each of these steps is represented by a CYF Block, signifying a distinct function or operation. Such an arrangement greatly streamlines the process of constructing intricate algorithms. 3- The act of connecting these blocks, essentially assembling the algorithm, serves as a visual aid that significantly enhances a programmer's comprehension of the underlying logic and operational sequence. 4- Accelerated algorithm creation and testing is a hallmark, as the need for extensive code writing is circumvented. This expedites the learning process, allowing users to grasp functionality and identify gaps swiftly. 5- By its very nature, it acts as a bulwark against certain coding errors, particularly those of a syntactical nature. 6- Its role extends to that of an educational instrument, effectively introducing programming concepts and instilling algorithmic reasoning.

JayMayer commented 1 year ago

Reviewed, move to "Done"