Code Monkey home page Code Monkey logo

best-loan-caclulator's Introduction

Best Loan Rate Quote Calculator

CLI program which takes a CSV and an amount of requested to borrow. The CSV contains different offers from lenders with the amount of money they have available and the rate at which they will lend it at.

The Program calculates the best rate available from the pool of lenders for a 36 month loan blending the interest rate if money has to be taken from multiple lenders. It builds the quote by taking the money from the best rate lenders first and the higher rate lenders if more money is required.

The quote is returned with monthly payments and total repayment calculated with monthly compounded interest.

You can request a quote from £100 to £15000 in multiples of 100. The application will only be able to provide a quote in funds are available in the pool of lenders provided on the CSV.

To run cd into directory.

./loan_calculator [CSV file] [amount]

Approach

The application was built with a TDD process to explore and learn about the domain via unit testing. This approach enabled me to create solutions for the best rate, blended rate and compounded interest calculations in a structured simple way.

I have used the approach that a unit is a unit of behaviour rather than an isolated component such as a class. Therefore in the unit tests the loan_calculator_spec.rb is dependant on the Offer class as their behaviour as collaborators is a unit.

CSV format

Your CSV should be in the below format. Rate percentages must be in decimal.

Lender,Rate,Available
Bob,0.075,640

A sample CSV market.csv is provided. This CSV file is also used for the tests.

best-loan-caclulator's People

Contributors

ljones140 avatar

Watchers

 avatar

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.