Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help plz

Help plz

Scheduled Pinned Locked Moved C / C++ / MFC
oophelptutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zakria81
    wrote on last edited by
    #1

    Hi everyone, can anybody help me by answering this question please: write a program that implements a Phone Number Encrypter. This entity should be capable of reading a telephone number as a string in the form (555) 555-5555. Reading should include validating the format i.e. while (555) 555-5555 would be correct, 5555555555 would be incorrect as also (555) abc-3128, (3m5) 523+3289. It should then extract the area code, the first three digits of the phone number and the last four digits of the phone number. The seven digits of the phone number should then be concatenated into one string. The next step would be to convert the area code and the seven digit phone number strings into ints. Finally, you want to encrypt the number as follows: • The area code should be converted to the binary notation using the complete number e.g. 555 would be 1000101011. Note that you would need 10 bits to accommodate all possible combinations • The seven digit phone number should be converted into binary notation where all digits should first be added and the sum be converted into binary notation. In the given example the sum of the digits in 5555555 is 35 and hence the binary notation will be 100011. Six bits should suffice to hold the results Finally the two encrypted binary representations should be concatenated. This would be a 16 digit binary number. Implement a class to represent a Phone Number Encrypter. Following good object oriented programming practices, keep the data members private. Accessor functions should be declared to set and get the private data if needed, your overloaded input operator should take care of reading the phone number initially. You are free to use c-strings or objects of string class to store the ISBN as a string, although, the object-oriented string class is recommended. Write a test program to illustrate the use of your class. I know it a long question but I really need your help...

    A M M 3 Replies Last reply
    0
    • Z zakria81

      Hi everyone, can anybody help me by answering this question please: write a program that implements a Phone Number Encrypter. This entity should be capable of reading a telephone number as a string in the form (555) 555-5555. Reading should include validating the format i.e. while (555) 555-5555 would be correct, 5555555555 would be incorrect as also (555) abc-3128, (3m5) 523+3289. It should then extract the area code, the first three digits of the phone number and the last four digits of the phone number. The seven digits of the phone number should then be concatenated into one string. The next step would be to convert the area code and the seven digit phone number strings into ints. Finally, you want to encrypt the number as follows: • The area code should be converted to the binary notation using the complete number e.g. 555 would be 1000101011. Note that you would need 10 bits to accommodate all possible combinations • The seven digit phone number should be converted into binary notation where all digits should first be added and the sum be converted into binary notation. In the given example the sum of the digits in 5555555 is 35 and hence the binary notation will be 100011. Six bits should suffice to hold the results Finally the two encrypted binary representations should be concatenated. This would be a 16 digit binary number. Implement a class to represent a Phone Number Encrypter. Following good object oriented programming practices, keep the data members private. Accessor functions should be declared to set and get the private data if needed, your overloaded input operator should take care of reading the phone number initially. You are free to use c-strings or objects of string class to store the ISBN as a string, although, the object-oriented string class is recommended. Write a test program to illustrate the use of your class. I know it a long question but I really need your help...

      A Offline
      A Offline
      Avi Berger
      wrote on last edited by
      #2

      I see that you have posted the text of your homework assignment. Unfortunately, you seem to have forgotten to include your actual question about it, or indicate what you have done on it. For more information, please see here[^]. Once you post your question, someone maybe able to help you.

      Please do not read this signature.

      1 Reply Last reply
      0
      • Z zakria81

        Hi everyone, can anybody help me by answering this question please: write a program that implements a Phone Number Encrypter. This entity should be capable of reading a telephone number as a string in the form (555) 555-5555. Reading should include validating the format i.e. while (555) 555-5555 would be correct, 5555555555 would be incorrect as also (555) abc-3128, (3m5) 523+3289. It should then extract the area code, the first three digits of the phone number and the last four digits of the phone number. The seven digits of the phone number should then be concatenated into one string. The next step would be to convert the area code and the seven digit phone number strings into ints. Finally, you want to encrypt the number as follows: • The area code should be converted to the binary notation using the complete number e.g. 555 would be 1000101011. Note that you would need 10 bits to accommodate all possible combinations • The seven digit phone number should be converted into binary notation where all digits should first be added and the sum be converted into binary notation. In the given example the sum of the digits in 5555555 is 35 and hence the binary notation will be 100011. Six bits should suffice to hold the results Finally the two encrypted binary representations should be concatenated. This would be a 16 digit binary number. Implement a class to represent a Phone Number Encrypter. Following good object oriented programming practices, keep the data members private. Accessor functions should be declared to set and get the private data if needed, your overloaded input operator should take care of reading the phone number initially. You are free to use c-strings or objects of string class to store the ISBN as a string, although, the object-oriented string class is recommended. Write a test program to illustrate the use of your class. I know it a long question but I really need your help...

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        What have you done so far ?

        Watched code never compiles.

        1 Reply Last reply
        0
        • Z zakria81

          Hi everyone, can anybody help me by answering this question please: write a program that implements a Phone Number Encrypter. This entity should be capable of reading a telephone number as a string in the form (555) 555-5555. Reading should include validating the format i.e. while (555) 555-5555 would be correct, 5555555555 would be incorrect as also (555) abc-3128, (3m5) 523+3289. It should then extract the area code, the first three digits of the phone number and the last four digits of the phone number. The seven digits of the phone number should then be concatenated into one string. The next step would be to convert the area code and the seven digit phone number strings into ints. Finally, you want to encrypt the number as follows: • The area code should be converted to the binary notation using the complete number e.g. 555 would be 1000101011. Note that you would need 10 bits to accommodate all possible combinations • The seven digit phone number should be converted into binary notation where all digits should first be added and the sum be converted into binary notation. In the given example the sum of the digits in 5555555 is 35 and hence the binary notation will be 100011. Six bits should suffice to hold the results Finally the two encrypted binary representations should be concatenated. This would be a 16 digit binary number. Implement a class to represent a Phone Number Encrypter. Following good object oriented programming practices, keep the data members private. Accessor functions should be declared to set and get the private data if needed, your overloaded input operator should take care of reading the phone number initially. You are free to use c-strings or objects of string class to store the ISBN as a string, although, the object-oriented string class is recommended. Write a test program to illustrate the use of your class. I know it a long question but I really need your help...

          M Offline
          M Offline
          Michael Schubert
          wrote on last edited by
          #4

          zakria81 wrote:

          I know it a long question

          I can't see any question.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups