First 2 in 222 has only 1 possibility (which will be typing a ). ("Enter phone number expressed in letters: ") Static Scanner console = new Scanner(System.in) 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. Typedefs should be prefixed by whatever is appropriate for that type: F if. Follow the instructions in the problem statement. Most other classes are prefixed by F, though some subsystems use other letters. I figured I can use each charAt position in a switch and check each letter from there, but the coding get's to long. Question: Design and implement a Java program for programming exercise 6.21, page 239 (name it PhoneKeypad), to display a given phone number with letters in all number format. Our series of elementary computer science courses guides students from visual block-based coding to professional line. 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. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |