Adblock breaks this site

A challenge for those who claim to know Java well

Discussion in 'Programming General' started by Pavel, Dec 12, 2008.

Thread Status:
Not open for further replies.
  1. Pavel

    Pavel Guest

    Referrals:
    0
    A challenge for those who claim to know Java well

    Hello.

    I have recently received an assignment where I have to write a program that will receive input Roman Numerals (e.g.: i, ii, ii, iv, v) and convert them into integer numbers and vice versa.

    How do you think I should go about doing this?
    No, I am not asking you to write the program for me, I am simply asking for help to get me started.
     
  2. fromdhood101

    fromdhood101 Forum Addict
    Banned

    Joined:
    Sep 26, 2007
    Posts:
    440
    Referrals:
    0
    Sythe Gold:
    0
    A challenge for those who claim to know Java well

    Something like:

    Code:
    if (input == 1) {
    write("I");
    } else {
    write("Invalid number. Please try again!");
    }
    That's very basic, but should give you a basic idea?
     
  3. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    A challenge for those who claim to know Java well

    His post was an example of how to do the conversion. It was meant to give you an idea what to do, not so you could bitch about it. Apply that concept to larger Roman numerals.

    I would say the easiest way is to loop through every character, add the number to the value depending on the letter (http://en.wikipedia.org/wiki/Roman_numerals#Symbols) and make the proper operations depending if the next letter is higher or lower than the one before it.
     
  4. Pavel

    Pavel Guest

    Referrals:
    0
    A challenge for those who claim to know Java well

    Last I checked, the point of programming was to make basic repetitive structures with the least amount of typing possible. Typing out each and every single fucking possible case wasn't what I signed up for.
     
  5. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    A challenge for those who claim to know Java well

    Clearly you're retarded because that's not at all what cp was saying. He was implying that you should parse the string entered and calculate the value based on what your function discovers at different positions. I don't even know why you're studying programming, you seem so useless.
     
  6. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    A challenge for those who claim to know Java well

    Nullware +1

    Do you know what a "loop" is? If you don't, I suggest you drop your course before it gets worse.
     
  7. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    A challenge for those who claim to know Java well

    Why are you even here if you are just going to moan about every single suggestion people give you?

    You've been told a good way to perform the conversion, now quit moaning. Jeeze...

    Do you even know what a loop actually is? If you don't, then you obviously haven't covered that work yet in your class therefore you probably wern't meant to use loops in your program.
     
  8. Pavel

    Pavel Guest

    Referrals:
    0
    A challenge for those who claim to know Java well

    Yes, I do know what a loop is. But what would I put in the loop, you geniuses?
    All of the suggestions were fucking retarded.
    How would I form a loop like this, please explain fucking geniuses.
     
  9. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    A challenge for those who claim to know Java well

    I will write the program because it is good practice.. Then i will try and help... i have no power, and my generator is about to die, so it might take awhile... LOL
     
  10. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    A challenge for those who claim to know Java well

    Get out.
     
< UltiCrack v2 [PASS CRACK] | What exactly can you make with these programming languages? >
Thread Status:
Not open for further replies.


 
 
Adblock breaks this site