ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 10 Weeks Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 28 Apr 2017 My Price 9.00

Write a program that takes an input

Write a program that takes an input from the keyboard representing a telephone number. The input will be valid if it contains 10 digits that are optionaly separated by either space or hyphen after the first and the second block of three digits. For example all the following should be considered valid phone numbers:

  • 1234567890
  • 123 4567890
  • 123 456 7890
  • 123-456-7890
  • 123 456-7890

 

Validate the input with matches method and using a do-while loop keep prompting the user until the valid input is given.

Once you have a valid telephone number, you should assume that the digits (only the digits, not hyphen or space) may have been encrypted by shifting each number by a constant value. For instance, if the shift is 2, 0 becomes 2, 1 becomes 3, 2 becomes 4, ..., 8 becomes 0, and 9 becomes 1.

We know that the user is from New York where the decrypted area code (after the shift is applied), represented by the first three digits of the input, is 212.

Your program needs to decrypt the telephone number and output the decrypted telephone number, as well as the shift value of the encyption. If there area code cannot be decrypted to 212, you should output that information instead.

Answers

(11)
Status NEW Posted 28 Apr 2017 03:04 AM My Price 9.00

-----------

Not Rated(0)