Skip to main content

Coursework

0) Flipped Classroom Practice (3h)

The video playlist contains 4 "content" videos and one "practice" video for each content video.

Here is an overview of the practice exercises:

1.1 Predict, evaluate and explain the following expressions in the node REPL

true
false
true === false
5 == 2 + 4
4 * 5 == "20"
4 * 5 === "20"
3 * 2 === 6
4 = 4
let mhairiName = "Mhairi"
let mhairiAge = 28
let isMhairOldEnoughToDrive = true
"hello Mhairi" === `hello ${Mhairi}`
`Mhairi is 28` === `mhairi is ${mhairiAge}`
"${mhairiName} is 28" === `Mhairi is ${mhairiAge}`
isMhairOldEnoughToDrive
isMhairOldEnoughToDrive === true
mhairiAge >= 18
mhairiAge >= 28
29 <= mhairiAge

typeof true
typeof false
typeof (5 === 2 + 3)
typeof 7
typeof 7.234
typeof "7"
typeof "hello CYF"

2.1 Write a program that defines a variable let eleniAge =

If Eleni is less than 18, the program should print out nothing to the console.

If Eleni is 18 years old or older, the program should print out:

Eleni is old enough to drive

2.2 Modify the program above so that if Eleni is less than 18 the program prints out:

Eleni is not old enough to drive

3.1 Predict, evaluate and explain the following expressions in the node REPL

false || false;
true && true;
let cats = 2;
let maximumCats = 5;
let minimumCats = 3;
cats < maximumCats && cats > minimumCats;
cats >= maximumCats || cats <= minimumCats;
let hasEnoughCats = 3 >= minimumCats;
let hasDogs = true;
hasEnoughCats && hasDogs;

3.2 Write a program that prints out to the console whether Sharde can come into a bar. Sharde can come into the bar if she is 18, or if she is accompanied by an adult.

How many different cases do you need to test to make sure your program is correct?

4.0 Write a program that prints out to the console the numbers from 3 to 7 (including both 3 and 7). Use a while loop. If you accidentally write a program that doesn't stop, press ctrl-c

3
4
5
6
7

4.1 Modify the program to also print out the sum of the numbers from 3 to 7 at the end

3
4
5
6
7
total: 25

4.2 Modify the program to only sum the multiples of 3 of the numbers from 3 to 7

Note that the expression to find out if a number is a multiple of 3 is n % 3 === 0.

3
4
5
6
7
total of multiples of 3: 9

5.1 (This is stretch practice - only do it if you have time) Write a program that prints out to the console the numbers from 1 to 10 (including both 1 and 10).

1
2
3
4
5
6
7
8
9
10

5.2 Modify your program so that multiples of 3 are replaced by the word "Fizz"

1
2
Fizz
4
5
Fizz
7
8
Fizz
10

5.2 Modify your program so that multiples of 5 are replaced by the word "Buzz"

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz

Note that you can add multiple if clauses with else if:

if (condition1) {
//...
} else if (condition2) {
//...
} else {
//...
}

5.3 Modify your program so that numbers that are both multiples of 3 and 5 are replaced by the word FizzBuzz. Also modify it so that it goes up to 20 instead of 10.

1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz

Pay special attention to the rows from 14 to 16. If you were successful, congratulations! This exercise has often been used to interview programmers to find out if they can actually code. (Historically, some students who come out of university with a Computer Science degree have not actually coded much. Others try to write the most efficient version immediately, instead of starting by writing code that works).

1) Review Solutions for Last Week's Coursework (45 minutes)

You should do this every week. We will stop reminding you soon as you get used to it.

Once a week, someone with Maintainer access in your region will release the solutions to last week's coursework by giving repo access to your class team.

Your class team is a child of Students and lives here: https://github.com/orgs/CodeYourFuture/teams/students/teams

Once you have access to the solutions repo, review your work compared to the example solutions. There is a marking guide that talks through common mistakes. Which ones have you made? How will this help you identify what you need to practice more, and where you feel strong?

Write down your target areas and take them to your buddy group. What does your mentor think? Do they agree with your assessment?

2) JavaScript Challenges (6 hours) 🔑

These exercises will help solidify your knowledge of JavaScript. Open the "Mandatory" folder and complete all of the challenges.

https://github.com/CodeYourFuture/JavaScript-Core-1-Coursework-Week2

3) Codewars (1 hour)

https://docs.codeyourfuture.io/course-processes/running-the-course/codewars

Every week you need to complete at least three kata. Spend at least 20 minutes, three times a week, on your kata workout.

Find the collection for JS-1 Week 2 on the CodeYourFuture account: https://www.codewars.com/users/CodeYourFuture/authored_collections

4) Learn About the Terminal part 1 (4 hours)

Most developers spend a lot of time using something called the terminal. This week, you are going to begin a course to learn about the terminal - it has its own homework page here for you to work from.

Do half this week and half next week.

5) (Stretch) Extra JavaScript Challenges

Have some extra time before our next class? Fill it with these harder challenges to help you stretch your abilities.

Alert: Some of these challenges include concepts that we haven't taught you yet. This is a common experience as a professional developer, so start learning how to handle it today. Use Google, talk to your network, share your blockers, and work the problem.

https://github.com/CodeYourFuture/JavaScript-Core-1-Coursework-Week2

9) Resolving conflicts (PD - 7 min)

Watch this 7-minute video on Resolving Workplace Conflicts.

10) Writing an email for an internship (PD - 1 hr)

Draft an email to apply for an internship at a fictional company called Vonda. Make sure to include the five things below:

  1. Why you want to become a software developer
  2. Your background and your past (as much as you are comfortable sharing)
  3. What you are doing at the moment
  4. Where you see yourself in the future
  5. Why Vonda should give you the opportunity to do an internship

Format the email so it is completely ready to send. Make sure you include a subject. Pay attention to the formatting: font type and size, alignment, and colours.