Git Product home page Git Product logo

bootcamp-week4-challenge's Introduction

Financial Analysis Console App

JavaScript Fundamentals: Console Finances

Table of contents

Overview

In this challenge, you'll be using the concepts you've learned to complete the required activity. 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 starter/index.js file.

The challenge

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 are 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.

Screenshots

Financial Analysis console output

Financial Analysis alert output

Financial Analysis Output

    Financial Analysis
------------------------------------------------------------------------
    Total Months: 86
    Total: $38,382,578.00
    Average Change: -$2,315.12
    Greatest Increase in Profits: Feb-2012 ($1,926,159.00)
    Greatest Decrease in Profits: Sep-2013 (-$2,196,167.00)
------------------------------------------------------------------------

Links

My process

I used

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Vanilla JavaScript

What I learned

A good understanding on how to use string formatter to output numbers with thousands and decimals, and include their currencies following the internationalization standards.

const formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
});
const str = formatter.format(1500);
console.log(str)

Continued development

  • Improve the UX/UI creating a website to display the financial analysis.
  • Create CRUD features to operate with the dataset.
  • Create an API to decouple data from presentation.

Useful resources

Author

Daniel Rodriguez

Acknowledgments

The teacher and TAs that help us with resources and support to my questions during the development of this challenge.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.