Git Product home page Git Product logo

lendingquotes's Introduction

LendingQuotes

A small console program that calculates optimal loans for borrowers, given a database of lenders and the requested amount.
Given a comma-separated list of lenders (each with a desired interest rate and available funds), and the amount required to borrow, the program will calculate how a loan can be constructed with the lowest possible interest rate.

Installation

Just clone and restore NuGet packages

Running

Run the program like so: LendingQuotes.exe <csv file name> <amount to borrow> (LendingQuotes.exe myCsv.csv 1000) where your CSV file is of the following format:

Lender,Rate,Available
Bob,0.075,640
Jane,0.069,480

The program will output the best available rate for the requested amount, along with the monthly repayment amount and the total repayment amount.

Structure

The bulk of the work is done by the Model classes. LoanBuilder is used to construct a Loan object using the optimal (= lowest interest) available lenders for the given amount.
Once constructed, the Loan object calculates the rate, monthly and total repayments, based on the given lenders.

The code structure is inspired by onion architecture.

Extending the current code

This is obviously a very simple program. To extend it to a full-blown application you'd probably want to do the following:

  • Move Model , DAL and Output to their own projects (DLLs)
  • Move tests to a separate DLL
  • Create tests for the repository and output classes
  • Use a proper DI mechanism
  • Consider moving the logic of calculating rate and repayments out of the Loan model. This will allow for a little more testability, but especially- for seemlesly changing the way these are calculated (using the Strategy pattern)

lendingquotes's People

Contributors

sjhonny-e avatar

Watchers

James Cloos avatar  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.