Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help writing an algorithm for java that displays digit on the telephone

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help writing an algorithm for java that displays digit on the telephone

    Develop an algorithm for a Java program that takes as input a single letter and displays the corresponding digit on the telephone. The letters and digits on a telephone are grouped this way:
    2 = ABC 3 = DEF 4 = GHI 5 = JK
    6 = MNO 7 = PQRS 8 = TUV 9 = WXYZ

    The screen dialog might look like this:
    Enter a single letter, and I will tell you what the corresponding digit is on the telephone.
    R
    The digit 7 corresponds to the letter R on the telephone.


    The program should display a message indicating that there is no matching digit for any non-alphabetic character entered by the user. Also, the application should recognize only uppercase letters. If a user enters a lowercase letter, the program should display an error message. Prompt the user with an informative message for the input value as shown above.
    The application should include the input letter as part of the output.

    Write the algorithm to solve this problem including steps for prompting the user, getting input from the keyboard, and displaying the results.

    Generate test cases as part of a Test Plan to exercise all branches of your program. Follow the guidelines on pages 108-9 of the textbook, Big Java, and provide complete coverage of all decision points. Use the Test Plan document to list all of your test data and the expected results.

    Write the Java program that you designed, using your algorithm as a guide. Use your algorithm as comments in the body of the main method.

    Use proper indentation, and meaningful identifiers throughout the code. Run each of the test cases that you created and record the results on the testing document. Upload both the source code and your completed test cases to the assignment link in Blackboard.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help writing an algorithm for java that displays digit on the telephone

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers, including a few "house rules" that you'd try to follow when visiting someplace new.

    When you say you want help, do you mean you want us to do it for you? That's not how it works. Make an effort, and then ask specific questions about what you're having difficulty with.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Help writing an algorithm for java that displays digit on the telephone

    Also posted at: Developing a program that inputs telephone numbers
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. ISBN-10 enter 9 digit to find the 10th digit
    By cldance5678 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 28th, 2013, 02:52 PM
  2. Telephone Number
    By Haiz in forum What's Wrong With My Code?
    Replies: 7
    Last Post: September 5th, 2013, 03:49 AM
  3. How do you write a Java program that displays your initials?
    By kala99 in forum Java Theory & Questions
    Replies: 3
    Last Post: November 30th, 2011, 02:12 PM
  4. HELP!!! Entry Class to represent entries in a telephone directory
    By Princess D in forum Java Theory & Questions
    Replies: 10
    Last Post: January 22nd, 2010, 05:39 AM
  5. How to detect audio input from a telephone call?
    By ces_31 in forum Java Theory & Questions
    Replies: 0
    Last Post: August 12th, 2009, 12:45 AM