Module 4 Challenge ⭐

Download your starter code for module 4 challenge

For this Challenge please unzip the zip file.

Video Speed Run if you get stuck

📺 Module 04 Challenge Video Walkthrough 🏃‍♀️🏃

Module Mac 🍎 Duration Window 🖼️ Duration
04 Video 📺 00:36:18 ⏲️ Video 📺 00:36:18 ⏲️

In this Challenge, you’ll be using the concepts you’ve learned to create a financial analysis tool.

JavaScript Fundamentals: Console Finances

This activity presents a real-world situation in which your newfound JavaScript skills will come in handy. You are tasked with creating code for analyzing the financial records of a company. You have been provided with a financial dataset in the index.js file.

Before you begin, download your starter code below

Challenge and unzip the zip file.

Instructions

  1. Create a new GitHub repo called Console-Finances. Then, clone it to your computer.

  2. Copy the starter files into your local git repository.

You have been given a dataset composed of arrays with two fields: Date and Profit/Losses.

Your task is to write JavaScript code that analyzes the records to calculate each of the following:

  • The total number of months included in the dataset.

  • The net total amount of Profit/Losses over the entire period.

  • The average of the changes in Profit/Losses over the entire period.

    • You will need to track what the total change in profits is from month to month and then find the average.

    • (Total/Number of months)

  • The greatest increase in profits (date and amount) over the entire period.

  • The greatest decrease in losses (date and amount) over the entire period.

When you open your code in the browser your resulting analysis should look similar to the following:

Financial Analysis
----------------------------
Total Months: 25
Total: $2561231
Average  Change: $-2315.12
Greatest Increase in Profits: Feb-2012 ($1926159)
Greatest Decrease in Profits: Sep-2013 ($-2196167)

Your final code should print the analysis to the console.

Hints:

  • You will need to do some research on your own for this project!

  • Remember, in order to combine strings and variables in the console, you will need to use concatenation.

  • How do you only print to the nearest 100th in JavaScript?