Write a program in any programming language that works as described here: Implement a method that gets a delimited string as input and returns the sum of the values.

  • An empty string returns zero
  • A single number returns the value
  • Two numbers, comma delimited, returns the sum
  • Two numbers, newline delimited, returns the sum
  • Three numbers, delimited either way, returns the sum
  • Negative numbers are ignored
  • Numbers greater than 1000 are ignored
  • A single char delimiter can be defined on the first line (e.g. # for a ‘#’ as the delimiter) * A multi char delimiter can be defined on the first line (e.g. [###] for ‘###’ as the delimiter)
  • Many single or multi-char delimiters can be defined (each wrapped in square brackets)

Use a coding standard like Google Java Style Guide or Java Coding Standard by Oracle and implement unit test like junit test

External Links


Sample code


tanszek/oktatas/quality_assurance_for_information_technology.txt · Last modified: 2019/03/14 14:30 by admin
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki