Coding Challenge to sort a list of names from a list in names.txt and make some calculations on the list.
-
Using names.txt a file containing over five-thousand first names, begin by sorting it into alphabetical order and store as sorted_names.txt
-
For each name in the sorted file Work out the alphabetical value and multiply by its position in the list to obtain a total name score.
Example Alphebetical Values are giving each letter a number based on position in the alphabet: A=1, B=2, C=3 etc The alphabetical value of COLIN is 3 + 15 + 12 + 9 + 14 = 53
The position is the numbered position of this name in the sorted list. Multiplying the name score with the position of COLIN in the sorted list (938) gets a total name score of 938 × 53 = 49714
Output: What is the grand total of all the total name scores in the file?
Optional Extras:
- What is the highest total scoring name and what position is it in?
- What is the lowest total scoring name and what position is it in?
- What is the highest alphabetical value for a name?
- What is the lowest alphabetical value for a name?
- What is the average alphebetical value for the names?
The technologies used in this project are as follows.
- C# .NET Core Web Application