Console application in a windows form: 10 digit telephone number problem
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Console application in a windows form: 10 digit telephone number problem

  1. #1
    Join Date
    Oct 2010
    Posts
    10

    Console application in a windows form: 10 digit telephone number problem

    I am working on this telephone problem and i need serious help. I am new to C# and this is very difficult for me. I would greatly appreciate in-depth help and guidance.
    people sometimes give their telephone numbers using one or more alphabetic characters. Write a program that accepts a 10-digit telephone number that may contain one or more alphabetic characters. Display the corresponding number using numberals. 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
    if the user enters a character that is not on the telphone as part of the number, display a message indicating that the value does not match a number. Allow both upper- and lowercase characters to be entered.

  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,782

    Re: Console application in a windows form: 10 digit telephone number problem

    The exercies is to help you learn. You will learn nothing if someone else does it for you.

    Post some code and someone may help by pointing out where you are going wrong.

    Basically you just need to write some code that will compare what the user entered to the valid characters. If they entered A or B then that would be a 1 if they entered a 1 that would be a 1 if they entered a $ display an error message.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Console application in a windows form: 10 digit telephone number problem

    You will never pass your class (or become a competent engineer) if you can't put in the effort to learn the basics.

  4. #4
    Join Date
    Oct 2010
    Posts
    10

    Re: Console application in a windows form: 10 digit telephone number problem

    for the telephone question would i use something like this:

    using System;

    namespace ConsoleApplication7
    {
    class Program
    {
    static void Main()
    {
    int inner;
    for (int outer = 0; outer < 3; outer++)
    {
    for (inner = 10; inner > 5; inner--)
    {
    Console.WriteLine("Outer: {0}\tInner:{1}", outer, inner);
    }
    }
    }
    }
    }


    but for numbers and letter???

  5. #5
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,874

    Re: Console application in a windows form: 10 digit telephone number problem

    Looking for a grade, or just can't resist the urge to be different?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center