GithubHelp home page GithubHelp logo

root-cc-driver-report's Introduction

Root Insurance Code Challenge

Author: Bryan Lewis

Usage

Ruby process initiated by command line by calling '/lib/Root_CC.rb' followed by space delimited input arguments that match files either fully qualified or relative to 'Root_CC.rb'.

After the program starts you will be prompted to input the minimum and maxiumum acceptable average trip velocity to include in reporting, if you prefer to keep the defaults you can just enter any non-float value to continue.

Once the program is configured you can begin inputting the command arguments 'Trip' and 'Driver', once an empty input is registered it will print a report of the current drivers registered.

After the report is outputted you will get the option to continue inputting commands, where if you want to continue you get the option to clear the currently stored driver registration history.

If you do not want to continue after a report just enter an empty command and it terminate the program.

Approach

My approach for this program was to aim for a simple, but extensible solution while adding a few additional features that were not in the requirements.

The first design decision was how to store the dataset that was registered, I chose a singleton based hashmap structure to allow easy management and accessibility throughout the project structure.

Secondly I wanted a way to deal with registering trip data for drivers that were not yet registered, so I created a driver class that has a property of registered that filters out non-registered users for the Driver Report

After I initializing how and where I store my data model I developed the interface of how to manage user input (both through file and CLI), where I landed on using regular expressions to determine valid and invalid user commands. The regular expressions were built to allow easy access to the capture groups of relevant data I wanted.

Another caveat I wanted to include with my user input was a way to generate a report mid-run and continue on the store -- or clear it and start generating a new report.

With the data model and input registration fleshed out the remainder was tying all the individual processes together and making sure end-to-end testing was successful.

Example Output From Given Test

Example Output

root-cc-driver-report's People

Contributors

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