Hello I looking for solution how I can sum up all the decimal values from collection where each char letter has its own value.
For example, lets say that I am looking to get the result for the word CAR. Because each letter represents its value I am looking to sum up the result and this should give an appropriate output. In this case 8.5. One more thing I am not looking for answer in LINQ.
Dictionary<char, double Letters = new Dictionary<char, double>(){
{'A', 1.5}, {'C', 3.9}, {'R', 3.1},
};
double result = CalculateScore("Car");
I would appreciate your help as I am new to C# and I have stuck with this task for while.