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 10 of 10

Thread: I have no idea where or how to start!!

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

    Exclamation I have no idea where or how to start!!

    Project: File Encryption


    Problem Description:

    Suppose an encrypted file was created using the encoding/decoding scheme . Each letter is substituted by some other letter according to a given mapping as shown below.
    String letters = "abcdefghijklmnopqrstuvwxyz";
    String enc = "kngcadsxbvfhjtiumylzqropwe


    For example, every 'a' becomes a 'k' when encoding a text, and every 'k' becomes an 'a' when decoding. You will write a program, encode or decode a File, and then encodes or decodes the File using the mapping above. Capital letters are mapped the same way as the lower case letters above, but remain capitalized. For example, every 'A' becomes 'K' when encoding a file, and every 'K' becomes an 'A' when decoding. Numbers and other characters are not encoded and remain the same.

    Write a program to read a file and encode the file to an encrypted file. And write a program to get an encrypted file and decode to original file. Your program should prompt the user to enter an input file name and an output file name

    What should you do?
    1. Ask for input file name/ output file name (encrypted file). The encrypt using above encode/decode.
    2. Ask for encrypted file and decoded to original input file.


    Need help with this, i have no idea where to begin. I ask for someone to start it off for me, i am very new to this. Any help is dearly appreciated.


  2. #2
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: I have no idea where or how to start!!

    What have you tried so far? Post any code you have written along
    with any problems - people can help you more

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  3. #3
    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: I have no idea where or how to start!!

    i have no idea where to begin
    This is baloney and a cop out. If you do not know how to write a class with a main() method, then you're not going to do well in this class, are probably failing it now, and most likely will ultimately fail it. Only you can fix that. There's nothing we can do.

  4. #4
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I have no idea where or how to start!!

    Quote Originally Posted by GregBrannon View Post
    This is baloney and a cop out. If you do not know how to write a class with a main() method, then you're not going to do well in this class, are probably failing it now, and most likely will ultimately fail it. Only you can fix that. There's nothing we can do.
    It's an intro class. But thanks for all your enlightenement, oh wise one.

  5. #5
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: I have no idea where or how to start!!

    I'm pretty sure Greg did not mean to sound unkind - it's probably the way you
    worded the problem, hence he just got the wrong end of the stick. If you are
    struggling, then please, share your code and algorithms for this problem
    and let's make a positive start on helping you.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  6. #6
    Member
    Join Date
    Apr 2014
    Posts
    219
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default Re: I have no idea where or how to start!!

    Greg and Norm are of the most helpful people on here. Think how many times they have read post like yours. No code, no flow chart, or any logical way they are thinking about solving the problem. I am sure it annoys them at times.

    On that note, break it down into smaller problems but first make sure you understand your requirements. Try to explain your thought process clearly if you are not going to post code, and if you do post code, please comment each line to what you think is happening.

  7. #7
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I have no idea where or how to start!!

    Different guy, just googled the problem because I was struggling. Really... I'm just not feeling the vibe somewhere when engineers have to come in and out-nerd someone who is just asking for help. Been there many times, never can dig it.

    Honestly speaking, Java is a dying language and I only chose to take the Intro class for credit and a bit of experience. Our professor is a great guy just not so much as a teacher. I can honestly say I don't know squat about Java in the 6th week of class. And by not knowing squat, I mean I can't sling a single line of good Java code for the life of me. I should've read the teacher reviews so I would've known he was gonna hit the ground running, but it said INTRO. Yet funny enough I should still leave the class with a B. But I digress.

    Anyway, this is a variation of what I ended up entering:

    Map<Character, Character> encode = new HashMap<>();
    Map<Character, Character> decode = new HashMap<>()

    //
    encode.put('A', 'g');
    decode.put('g,', 'A');

    Was it right? Nah. But it was something

  8. #8
    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: I have no idea where or how to start!!

    I prefer you not hijack someone else's thread, but it's too hard to pull your post out and make it stand on it's own, so we'll go with it. And why the attitude about Java? That's just trollish behavior, but I'll ignore that for now and assume you to be asking a sincere question.

    The "Intro to Java" stage does not usually allow the use of advanced features like maps. If there was no prohibition on the core Java classes that could be used, your solution might work, though I'd have to see more code to be sure. More typically, a String of 26 alpha characters or a character array out of order to provide the encrypt/decrypt key are used at the intro level, similar to what the OP had suggested in the first post.

  9. #9
    Junior Member
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I have no idea where or how to start!!

    hahahaha. Dude you are exactly what I thought you were. Right, I hijacked this thread and am trollish, because you were so helpful before.

    OP is a classmate. Not very hard to deduct given he made his account his actual name. The project is done. You were of no help when it mattered. That's interesting about maps. oh well. Anyway I'm not the one with an attitude problem, but hey, some things don't get better with time.
    best

    PS: My attitude about Java is practical and shared by many. I'm not giving you the numbers or anything because that's just baloney and a cop out Go google it!

  10. #10
    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: I have no idea where or how to start!!

    Good luck to you both!

Similar Threads

  1. [SOLVED] idea
    By josselynmedina95 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 22nd, 2014, 03:29 PM
  2. Almost got no idea how to do this! Need some H E L P!
    By maronski in forum Loops & Control Statements
    Replies: 6
    Last Post: July 30th, 2012, 10:23 PM
  3. Blog idea
    By dks in forum Java Theory & Questions
    Replies: 3
    Last Post: February 17th, 2011, 02:48 PM
  4. need help with my idea!
    By frostwing in forum Object Oriented Programming
    Replies: 3
    Last Post: February 10th, 2011, 09:53 AM
  5. No idea what to do for this
    By jwb4291 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 18th, 2010, 07:16 PM