Skip to content

A repository for Makers coding review 1, conducted 23/02/2022.

License

Notifications You must be signed in to change notification settings

JoshSinyor/review-2022-02-23

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Version License Code Size Ruby Style Guide Deployment CI Badge

Makers Review 1

This repository reflects Makers coding review 1, conducted 23/02/2022.



Installation

This project requires Ruby 3.0.0. If you do not have Ruby 3.0.0, install it using these instructions.

  1. Clone or fork this repository.
  2. Install the necessary Gems from the Gemfile by executing bundle install.

Specification

  1. The purpose of this program is process school test results.
  2. This program receives input of results as a string of comma-separated values. These values could be in any combination of upper- and lower-case.
  3. This program should parse this string, and sum the total of each instance of the colours green, amber and red.
  4. The program should return the totals in the format Colour: #, with each of the three colours returned on a new line.
  5. Even if no instances of the three colours are found, the sum of that colour should be returned.
  6. This program should sum the total of any instance of any other input as Uncounted.
  7. If no Uncounted instances are found, the program should not return Uncounted as a category.

Input/Output Table

Input Output
"Green" Green: 1
"Green, green" Green: 2
"Green, AMBER, Red" Green: 1\nAmber: 1\nRed: 1\n
"Green, Yellow" Green: 1\nUncounted: 1

Acceptance Criteria

This program must:

  1. Parse the input of a string of the colour green, amber or red.
  2. Parse the input of a CSV string of at least two instances of the colour green, amber or red.
  3. Parse the input of a CSV string of at least two of the colours green, amber and red.
  4. Parse the input of a CSV string of colours which are not green, amber or red.
  5. Raise error Please input a string of comma-separated values. upon the input of anything other than a String object.

Input/Output Table

Input Output
"Green" Green: 1\nAmber: 0\nRed: 0
"Green, green" Green: 2\nAmber: 0\nRed: 0
"Green, Amber, red" Green: 1\nAmber: 1\nRed: 1\n
"Green, Yellow" Green: 1\n\nAmber: 0\nRed: 0\nUncounted: 1
"Green, Amber, RED, green, Yellow, Red" Green: 2\nAmber: 1\nRed: 2\nUncounted: 1
["Green", "Amber", "Red"] Error Please input a string of comma-separated values.

Final Appearance

This program is pictured below executing the instructions in the Acceptance Criteria.

acceptance_criteria_screenshot


Dependencies

This program's dependencies are minimal and relate solely to testing. All dependencies are explicitly invoked in the Gemfile.


Author(s)

Authored by Joshua Sinyor.


License(s)

This project is licensed under the MIT License.


Acknowledgements

About

A repository for Makers coding review 1, conducted 23/02/2022.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages