Businesses sometimes give their telephone numbers using alphabetic characters instead of (or in addition to) numerals. Write a program that accepts a telephone number string that may contain alphabetic characters, and displays the corresponding number with only numerals. The numbers and letters are associated as follows on your telephone:
ABC: 2
DEF: 3
GHI: 4
JKL: 5
MNO: 6
PQRS: 7
TUV: 8
WXYZ: 9
Your program should allow formatting characters (the left and right parentheses and the hyphen) in the displayed numeric string. If the user enters other characters that are not on the telephone dial, your program should ignore those characters. Allow both upper- and lower-case alphabetic characters to be entered. Your program can accept a longer string, but should display only up to ten numbers in the result.
int phonenum;
Console.writeline( "Enter your phone number: ");
phonenum = int.parse(console.readline());
but now im adding in letters to the mix, i have a feeling that int and decimal wont work here. So no im curious as to how to start this.
Once that is settled, how to do i go apart breaking up the number so i can analyze the number digit by digit? Because if they entered a full 10 digit long number, wouldnt the program think its a number in the billions then, and not 10 individual digits? but more importantly, how do i break up a number like 800-cod-hard. I need to be able to allow the "-" as well as have the program realize the 800 isnt 800, but 8, 0, 0. Finally, what the hell is a switch, and how do i use it?