• Log in or sign up for an account here: https://www.sythe.org/login

A challenge for those who claim to know Java well

  • Thread starter Thread starter Pavel
  • Start date Start date
Status
Not open for further replies.
P

Pavel

Guest
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.
 
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?
 
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.
 
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.

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.
 
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.
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.
 
Nullware +1

Do you know what a "loop" is? If you don't, I suggest you drop your course before it gets worse.
 
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.
 
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.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
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
 
Get out.
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top