Git Product home page Git Product logo

challenge-calculator's Introduction

challenge-calculator

Restaurant365 Code Challenge - String Calculator

Summary

Create a calculator that only supports an Add operation given a single formatted string

  • C# console application
  • Include unit tests
  • Provide code via a public distributed version control repository i.e. GitHub. Do NOT fork this repo
  • Show each step as a separate commit
  • Efficient code is always important but for this excercise readability and separation of concerns are much more critical
  • Not including one or more of the stretch goals will not affect your overall assessment but implementing them poorly will

Requirements

  1. Support a maximum of 2 numbers using a comma delimiter
    • examples: 20 will return 20; 1,5000 will return 5001
    • invalid/missing numbers should be converted to 0 e.g. "" will return 0; 5,tytyt will return 5
  2. Support an unlimited number of numbers e.g. 1,2,3,4,5,6,7,8,9,10,11,12 will return 78
  3. Support a newline character as an alternative delimiter e.g. 1\n2,3 will return 6
  4. Deny negative numbers. An exception should be thrown that includes all of the negative numbers provided
  5. Ignore any number greater than 1000 e.g. 2,1001,6 will return 8
  6. Support 1 custom single character length delimiter
    • use the format: //{delimiter}\n{numbers} e.g. //;\n2;5 will return 7
    • all previous formats should also be supported
  7. Support 1 custom delimiter of any length
    • use the format: //[{delimiter}]\n{numbers} e.g. //[***]\n11***22***33 will return 66
    • all previous formats should also be supported
  8. Support multiple delimiters of any length
    • use the format: //[{delimiter1}][{delimiter2}]...\n{numbers} e.g. //[*][!!][r9r]\n11r9r22*33!!44 will return 110
    • all previous formats should also be supported

Stretch goals

  1. Display the formula used to calculate the result e.g. 2,4,rrrr,1001,6 will return 2+4+0+0+6 = 12
  2. Allow the application to process entered entries until Ctrl+C is used
  3. Allow the acceptance of arguments to define...
    • alternate delimiter in step #3
    • toggle whether to deny negative numbers in step #4
    • upper bound in step #5
  4. Use DI
  5. Support subtraction, multiplication, and division operations

challenge-calculator's People

Contributors

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