This program will take an array of colors and return a String with the values associated with
Fantastic news! We've Found the answer you've been seeking!
Question:
This program will take an array of colors and return a String with the values associated with those colors.
black=0
brown=1
red=2
orange=3
yellow=4
green=5
blue=6
violet=7
grey=8
white=9
black=0
brown=1
red=2
orange=3
yellow=4
green=5
blue=6
violet=7
grey=8
white=9
For example if the input is "blue","white","brown" the returned String would be "691" or if input is "grey" the returned String would be "8"
Create a class for doing work
There should be no class level variables but initialize the color array as a class constant
Create method that takes in string array and returns string
Try to put some of the work in other methods only seen by the created class
public class Resistor {
public String execute(String[] colors) {
return null;
}
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date: