Assignment 2 Due at 11:00 AM on November 22, 2016.

Added on - 16 Sep 2019

  • Dissertation

    type

  • 4

    pages

  • 1007

    words

  • 109

    views

  • 0

    downloads

Showing pages 1 to 2 of 4 pages
Assignment 2 Due at 11:00 AM on November 22, 2016(100 pts)Objective: You will implement hash table with chaining.The international standard letter/number mapping found on the telephone is shown below:Using these characters on the key-pad, we can come up with word-based representation of aphone number so that it would be easy to remember. For example, 1-800-AAA-HELP. This isvery much easy to remember than 1-800-222-4357. It is obvious that some phone numberscannot be turned into word-based representation. For example if the number has 1 or 0,then there is no corresponding characters on the key-pad. Some time we may not findmeaningful word to represent the given number even if it does not contain 0 or 1. In thisproject, you will write a program that will ask user to enter a phone number (10-digitexcluding leading 1) and will print out the word-based representation if exist otherwise it willindicate that there is no meaningful word-based representation of the given number and justprint out the given number in the following form: 1-area-exchange-number.A typical phone number has three components:1)area(three digit)2)exchange(three digit)3)number(four digit)As you have seen in the example above, if one wants to find out the word-basedrepresentation of a given phone number, he/she will find the word based representation of
exchangeandnumberi.e. last 7-digit of the given phone number. There are severalpossibilities here:1)If there is only word-based representation of whole 7 digits2)Else If there is only word-based representation ofexchange(3 digit) andnumber(4digit)3)Else If there is word-based representation of onlyexchange(3 digit)4)Else If there is word-based representation of only number (4 digit)5)Else there is no word-based representation given number.Hence your program should do the following:1)If there exist 10-digit word-based exist, then print it (or all if more than one).2)If there exist 7-digit excluding area code, then print out it (or all if more than one).3)If 7 and 10 are not possible, then print 3-digit followed 4-digit form. Again printallpossibilities.4)If step 1, 2, and 3 are not possible, then print only theexchangein a word-basedform.5)If step 1, 2, 3, and 4 are not possible, then print only thenumberin word-based form.6)If none is possible, then print the number in 1-area-exchange-numberform.Examples:1)Given number is 2266762559, then your output should be:1-ABNORMALLY2)If the given number is 2702637422, then your output should be:1-270-AMERICA.3)If the given number is 6157862243, then your program should print out the followingnumbers:1-615-RUN-ACHE1-615-RUN-ACIDThere is no meaningful word for 7862243. So we look at the words for 786 and 2243.These are RUN, SUM, SUM and ACHE, ACID, CAGE. The all possible are listed asabove.4)If the given number is 1939292244, then it returns/lists the following phone number:1-193-WAX-22441-193-WAY-22445)If the given number is 18003218428, then it returns/lists the following phone number1-800-321-THAT6)If the given number is 18002002244, then it returns/lists the following phone number1-800-200-2244
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document