I need soundex program in c++
An algorithm is:
Use a switch() sttement to phonetically group characters as follows:
group 0: A E I O U H W Y plus all non-alphabetic characters
group 1: B F P V
group 2: C G J K Q S X Z
group 3: D T
group 4: L
group 5: M N
group 6: R
then a sequence of characters is encoded as follows:
1 each character is replaced by its group digit, i.e. SMIT becomes 2503, SMITH becomes 25030 and SCHMIDT becomes 2205033
2 consecutive similar digits are replaced by a single digit, i.e. SMIT remains 2503 and SMITH and SCHMIDT become 20503
3 zeros are removed and SMIT, SMITH and SCHMIDT become 253.