Week 2 - Programming basics

JavaScript

Basic Syntax

Variables

Data types

Numbers

Basic IO

Conditionals

Nested conditions

Git branches

GUI Tools for Git

Code style: Basics

Introduction to AI

Practice

Assignment

Back to core program

Week 2 Assignment

Task 1 - Leap Year Check

A leap year has 366 days instead of 365, with February receiving an extra day. Here are the rules for determining a leap year:

  1. A year is a leap year if it is divisible by 4
  2. However, if the year is divisible by 100, it is not a leap year
  3. Unless the year is also divisible by 400, in which case it is a leap year

Examples:

Write a JavaScript application that gets a valid year from a prompt and prints one of the following outputs:

Replace <YEAR> with the year provided by the user.

A Valid year is between 0 and 9999.

Task 2

Write a coin toss game

Submission


The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 **

CC BY-NC-SA 4.0 Icons

*https://hackyourfuture.net/*