Week 2: Controlling the Flow of a Program
Main Objective: Learn the basic building blocks of all programming languages to solve simple algorithms.
Lessons:
- Building Blocks of a Program
- Review and discussion of Chapter 2
- Syntax vs Style
Project:
The graded project this week is on problem solving using our basic building block algorithms. Go to the repl.it classroom and complete three Wk 2: Project Problems. Everyone must complete problem A and B, but you can choose which version of problem C you solve based on your level of comfort this week. Here is the grading breakdown for each problem:
- 6 points: Show the correct steps in comments
- 3 points: Produce the correct solution in code
- 1 point: Follow the style guidelines
Assessment:
Go to your cset
repo on GitHub and create a new file in the 105
folder called assessment-2.md
. Add your answers to the following questions to the file and "commit" them to GitHub. Here are the guidelines if you forget them.
- After two weeks, what do you think is going to be your biggest challenge with this program? And how will you try to overcome it?
- Describe the differences between the three styles of loops:
for
,while
, anddo...while
. - We've learned to split problem solving into two parts: writing the solution in English or pseudocode, then translating the solution into JavaScript. Why is this important and how will it help you in future classes?
Reference:
- MDN: Storing the information you need - Variables
- MDN: Making decisions in your code - Conditionals
- MDN: Loops and iteration
More Resources:
- Codecademy: Introduction to JavaScript
- Interactive lessons to write and check code.
- The first two lessons, "Introduction" and "Conditionals" will closely match this week's chapter.
- They introduce "Functions," "Scope," and "Arrays" next. We haven't learned so don't worry about them yet. Although some parts of lesson six on "Loops" will rely on them.
- FreeCodeCamp: Introduction to JavaScript
- More interactive lessons.
- The lessons "Comment Your JavaScript Code" through "Understand String Immutability" will match this week's chapters. If you get to "Arrays," you're going beyond what we're learning.
- This lesson uses an older version of JavaScript, so look at the first three lessons in their unit on ES6, the version of JS we're learning.