homework 0: Hello Web World

This is a basic environment check assignment. It will walk you through using the tools that we will use for submitting assignments in this class.

These tools consist of:

  • The git version control system
  • GitHub and GitHub Classroom
  • Gradescope

Before starting, you will need a GitHub account. Feel free to use your personal GitHub account, or an account that you have created specifically for this class.

It’s highly recommended that you set up ssh keys for performing git operations. GitHub has some pretty good documentation for setting that up here.

The primary workflow for assignments will be:

  1. A GitHub Classroom link is posted, which will create a homework repository for you.
  2. Clone your new github repository to your development environment
  3. Develop your code.
  4. When you think the code is ready to be graded, upload it via Gradescope.
  5. When relevant, the Gradescope autograder will run and give you feedback on your achieved score on the assignment.

Some assignments will have right answers that can easily be checked with the autograder; some will need to be checked manually. This one has an autograder.

The programming task

The programming task is to write a fizzBuzzOutput() function in JavaScript that takes a number between 1 and 100 and returns “Fizz” for multiples of 3, “Buzz” for multiples of 5, “FizzBuzz” for multiples of both, and the integer value itself as a string representing the integer otherwise (e.g. fizzbuzz(2) = "2"). While we haven’t covered any JS yet, you should be able to use your experience with basic Java/C style syntax to write a functional solution.

Environment setup

The only software you should need to download to set up the environment is Node.js 12. Once you have successfully installed Node and downloaded your clone of the skeleton code, you can bootstrap your local environment by running the command npm install at the command line in teh root of the skeleton repository.

The coding environment includes a test framework called Mocha. We will go into more detail regarding Mocha (and Node, and npm, etc. later in class. The four tests that the autograder uses to test your code in test/fizzbuzz.js. You don’t need to be able to fully understand the test file syntax, but you can run the tests using the command npm test. If you run this as soon as you have downloaded the repository and run npm install, you should see a lot of errors due to failing tests. As you finish fizzBuzzOutput(), the tests should all complete successfully.

Regardless of whether you have your tests all working or not, it is highly recommended that you commit and push your code early and often. If you haven’t worked with git before, there are copious resources on the web: this is a good basic intro.

Submitting your code

To submit your code, log in to Gradescope and submit your code from your GitHub repository. There’s no need to test directly using the autograder - the tests are exactly the same between the autograder and the local test/ subdirectory.

There are 100 possible points on this assignment, 25 for each test. There is no partial credit, and assignments will not be accepted in any way besides Gradescope. This assignment is due Friday, January 25th, at 11:59 PM

You can accept the assignment at this link.