![]() This will likely get you a bad grade if you make a case for every letter of the alphabet and enter it's corresponding number, but if you use some of the features of case statements like "fall through" (no link, I leave it to you to research what that is) you will likely get a good grade. Make a switch statement for every letter or number a person could enter. So my real question is: How do I store the input number as a character and then define those characters with case statements?ĭo not use a Dictionary class if it has not been covered in class, you will likely get a bad grade on the assignment as this homework is to be solved using the tools you learned in class. Console.WriteLine("Write a Phone Number that consists of Seven Numbers.") Ĭonsole.WriteLine("You have entered a phone number that is too long.") Ĭonsole.WriteLine("You have entered: ", Number) ![]() I really hate this assignment because we just did two assignments with Cases and If statements, it just seems redundant to me. Right now I have nothing done except for an input, but it's not stored as characters, just a string. The program will perform the conversion per a standard telephone keypad layout. ProcessInput(): Calls ToDigit() for each, passing each character variable by reference, and returns one of these codes to Main() by value:.GetInput(): Gets seven characters from the user and stores them into the seven variables Main() has passed by reference.ProcessInput(): gets user input and performs the conversion.Main(): Declares seven character variables and passes these to the following methods by reference:.The input may contain digits, letters, or both. The user will input eight characters and the program will output either an error message or the translated seven-digit phone number. Your mission: A prepaid phone service needs a program that converts alphanumeric keyboard input into a phone number. (I really don't see the point of this assignment, which might be contributing to my coder's block.) Here's what the assignment says. There is no logic behind the letters the numbers are changed to. Then each character is changed to a letter. Each number is stored as a different character. So for this C# class I have to have the user input a 7 digit phone number into the console.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |