Hw1
Possible Points | Due Date |
---|---|
50 pts | September 8th - Before Class |
Overview
In this homework assignment, you will download a JSON dataset from the web and write a simple data analytics package in JavaScript to answer eight questions about your dataset.
Assignment Instructions
Step 1: Download a JSON dataset from a website
In this step, you will collect a JSON dataset containing at least 100 rows (i.e., entries) from a website. You are free to choose whatever data source you’d like. Note that some, but not all, data sources may first require you to obtain an API key by creating an account with the data provider. You should not choose any API that requires you to authenticate using oAuth, as we have not yet covered oAuth.
You may, but are not required to, choose a data set from one of the following:
- Open Data DC
- Public APIs (many of these are APIs for performing computation and are NOT datasets, check carefully)
- DC Metro
After choosing an API, you should collect a dataset containing at least 100 records in JSON format. It’s fine if your dataset contains more than 100 records. If you dataset is very large (> 10,000 records), you may wish to choose a subset of the dataset to enable you to test your code more quickly in the following steps.
Step 2: List eight (8) questions you will answer about your dataset
Now that you’ve found a dataset, what insights can you extract from this dataset? In this step, you will write a list of eight (8) questions about your dataset. Each question should describe a statistic to compute from your dataset.
For example, if your dataset is city demographic data, you might have the following questions:
- What is the average age of residents?
- What is the average year over year growth rate?
- What is the fastest growing city?
- What is the median population density?
- What is the city with the highest population density?
- Which is the average age of small cities with less than 100,000 people?
- What is the city with the oldest population?
- What is the city with the least amount of new home construction per capita?
In order to more easily satisfy the requirements of step 3, you are encouraged to have a diversity of question types.
Step 3: Implement a JavaScript program to answer your questions
In this step, you will now create a JavaScript program to compute the answers to your eight questions using your JSON dataset. For each of the eight questions, your program should output to the JavaScript console (1) the question and (2) the answer. For example, if your question was “What is the fastest growing city?”, your program should write to the console: “What is the fastest growing city? Springfield”
Your program must use all of the following JavaScript features:
-
Variable declarations
- Let statement
- Const statement
-
Functions
- Arrow function
- Default values
- Array.map()
-
Loops
- For of statement
- For in statement
-
Collections
- Instance of a Map or Set collection (only 1 is required)
-
Strings
- Template literal
-
Classes
- Class declaration
- Constructor
- Using an instance variable with this
You are welcome and encouraged to consult any publicly available resource you wish (e.g., Mozilla Developer Network documentation, tutorials, blog posts, StackOverflow). However, in this assignment, all of the code you submit should be your own.
Submission instructions
- Submit your HW through replit. Please follow these instructions for signing up for the replit account and accessing HW1. You should be able to complete this project using only the replit web interface. However, if you would like to work locally on your machine, you can code using your preferred environment and then upload the final
.js
files through replit.
The HW assignment submission should consist of two .js
files one called data.js
containing the following:
- A comment containing a URL where your JSON dataset from step (1) can be found
- Your JSON dataset from step (1) (or a subset of the dataset that is at least 100 records)
and another call script.js
containing the following:
- A comment with your full name and G-number
- Your program from step (3)
Grading Rubric
The grading for this project will be broken down as follows:
- 8 Valid Questions about Dataset - 1 point each (8 points total) - We will take into account whether or not the question can be answered programmatically using your dataset.
- Valid JSON Data - 6 points, your JSON data must have at least 100 entries and must have enough attributes to be able to form 8 meaningful questions to answer.
- Javascript Features - 3 points each (36 points total) - You must use each requested feature and each feature must be used in the calculation of the answer of at least one of your questions.