![]() ("Enter phone number expressed in letters: ") Static Scanner console = new Scanner(System.in) 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 are the possible numbers. Programmers use machine languages such as ASCII or Unicode to reference alphanumeric characters. Write a program that prompts the user for a seven-digit number and writes to a file every possible seven-letter word corresponding to that number. But I wanted to ask if there is a better way to code this, using a loop maybe to increment each character and just one switch statement. The letter A in binary, for example, is 01000001. I figured I can use each charAt position in a switch and check each letter from there, but the coding get's to long. And I am supposed to use the charAt method to extract each character. The user can use lowercase and uppercase letters, as well as spaces between words. by that character and add the sequence stored in that array. For each character, store the sequence which should be obtained at its respective position in an array, i.e. ![]() I have to write a program that prompts the user to enter a phone number expressed in letters and outputs the corresponding phone numbers in digits. Approach: Follow the steps given below to convert a sentence into its equivalent mobile numeric keypad sequence.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |