The electronic color code is used to indicate the values or ratings of electronic components, very commonly for resistors.
This app implements an electronic color code calculator based on the information found here on Wikipedia and the interface provided below:
public interface IOhmValueCalculator
{
/// <summary>
/// Calculates the Ohm value of a resistor based on the band colors.
/// </summary>
/// <param name="bandAColor">The color of the first figure of component value band.</param>
/// <param name="bandBColor">The color of the second significant figure band.</param>
/// <param name="bandCColor">The color of the decimal multiplier band.</param>
/// <param name="bandDColor">The color of the tolerance value band.</param>
int CalculateOhmValue(string bandAColor, string bandBColor, string bandCColor, string bandDColor);
}
- Write a class that implements the following interface. Feel free to include any supporting types as necessary.
- Using your favorite unit test framework, write the unit tests you feel are necessary to adequately test the code you wrote as your answer to question one.
- Create a .NET MVC or Reactjs web interface that will allow someone to use the calculator you created in step one.
- Submit your code by a public or private repository like github, gitlab or bitbucket.
- The above interface expects all four bands for the ohm value calculation but only wants a single int returned. Typically, when the fourth band (tolerance) is taken into consideration, a range of resistances are returned. At the least, two ints.
This project was bootstrapped with Create React App.