Giter Site home page Giter Site logo

it_dev_risk-csharp's Introduction

IT DEV RISK - CSharp

Problem: Categorize trades in a bank´s portfolio

A bank has a portfolio of thousands of trades and they need to be categorized. A trade is a commercial negotiation between a bank and a client. A trade has many characteristics, including:

interface ITrade

{
...
double Value { get; } //indicates the transaction amount in dollars
string ClientSector { get; } //indicates the client´s sector which can be "Public" or "Private"
DateTime NextPaymentDate { get; } //indicates when the next payment from the client to the bank is expected
...
}

Currently, there are three categories (in order of precedence):

  1. EXPIRED: Trades whose next payment date is late by more than 30 days based on a reference date which will be given.
  2. HIGHRISK: Trades with value greater than 1,000,000 and client from Private Sector.
  3. MEDIUMRISK: Trades with value greater than 1,000,000 and client from Public Sector.

Write a C# console application using object oriented design that classifies all trades in a given portfolio. Keep in mind that the real application may have dozens of categories, so your design must be extensible allowing those categories to be easily added/removed/modified in the future. The code can be sent in a GitHub link

Input
The first line of the input is the reference date. The second line contains an integer n, the number of trades in the portfolio. The next n lines contain 3 elements each (separated by a space). First a double that represents trade amount, second a string that represents the client’s sector and third a date that represents the next pending payment. All dates are in the format mm/dd/yyyy.

Output
N lines with the category of each one of the n trades.

Sample input
12/11/2020
4
2000000 Private 12/29/2025
400000 Public 07/01/2020
5000000 Public 01/02/2024
3000000 Public 10/26/2023

Sample output
HIGHRISK
EXPIRED
MEDIUMRISK
MEDIUMRISK

it_dev_risk-csharp's People

Contributors

fabioferan avatar

Stargazers

 avatar

Watchers

 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.