CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2009
    Posts
    1

    Help with C# console application

    Hello,
    I need help with creating a console application on C# If somebody can help I will be very thankful! Here is my exercise:


    The action of a Caesar cipher is to replace each plaintext letter with one a fixed number of
    places down the alphabet. This example is with a shift of three, so that a B in the plain text
    becomes E in the cipher text. In cryptography, a Caesar cipher, also known as a Caesar's
    cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely
    known encryption techniques. It is a type of substitution cipher in which each letter in the
    plaintext is replaced by a letter some fixed number of positions down the alphabet. For
    example, with a shift of 3, A would be replaced by D, B would become E, and so on. The
    method is named after Julius Caesar, who used it to communicate with his generals.
    American Standard Code for Information Interchange (ASCII) is a character encoding based
    on the English alphabet and it is included in UNICODE standard. ASCII includes definitions
    for 128 characters: 33 are non-printing, mostly obsolete control characters that affect how text
    is processed; 94 are printable characters (the space is not printable). The ASCII character
    encoding is used on nearly all common computers, especially personal computers and
    workstations.
    Develop a static class with two methods, one for encoding and one for decoding. Both
    methods take a string as parameter and return the processed string. You develop an algorithm
    that substitutes a given character with one with 4 places down in alphabet and another that
    decodes the ciphered text. Create a Console application that tests your methods.


    Thanks in advance!

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

    Re: Help with C# console application

    No one here is going to do your homework for you.

  3. #3
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: Help with C# console application

    It has been seen thousend of times that its no help to do your work for you. In real life you need to do your job and nobody can do it for you. If someone does the work for you, you will not be able to see your own problems, you will not be able to learn of your mistakes and you will stay unable to solve this easy and bigger problems in future. Cheating alwasy is cheating yourself.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Help with C# console application

    The solution is already given, you just need to write the code. Just write it.
    Develop a static class with two methods, one for encoding and one for decoding. Both
    methods take a string as parameter and return the processed string. You develop an algorithm
    that substitutes a given character with one with 4 places down in alphabet and another that
    decodes the ciphered text. Create a Console application that tests your methods.

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Help with C# console application

    I've got the answer. I solved this very one last night.

  6. #6
    Join Date
    Feb 2009
    Posts
    112

    Re: Help with C# console application

    I had to do a project similar to this once. This requires a little more work, but you can make an array with the ACSII Codes and reference the array. You can use google to find a list that is easily formattable for putting it in an array in c#.

    Good Luck.
    - It's a long way to the top if you want to rock n' roll - AC/DC

    Check out my band and support the music:
    www.blueruinmusic.com

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured