Jon Lewis

Greenhorn
+ Follow
since Aug 31, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jon Lewis

Thanks for the reply Jinny. The Timestamp class is, I believe, unique to this excercise. Here is the whole Timestamp class:

Again, the excercise states that this doesn't need to be changed but since you got it to work using just Calendar I wonder why it's there at all.
A couple of questions...Don't I need to convert the integers produced by the calls to the Calendar class to strings, and since there's no roman numeral for zero, could that be part of what I'm missing?
Also, would you be kind enough to post the code that you used?
Thanks again and thanks in advance to anyone who'll help with this maddening problem!
16 years ago
Hi Marc, thanks for the reply and kind welcome.
The first code I posted was the complete java file for the display portion of the little app, and according to the excercise it is the only file I would need to change (which makes sense).
The only code I left out was, I simply repeated the else if statements going up to 9 in roman numerals...which is I think where the problem is, but the only other way I could think of is, having 59 else if statements and that seems excessive.
The rest of the code remained untouched. I really appreciate you helping me think this through--I can't wait to find out what it is I'm missing!
16 years ago
Hi all, I'm new to all this and am trying to learn through the book Just Java 2, but one of the very first excercises has me stumped!
It's a simple digital clock, and the problem is to change the file that handles the view so that it displays roman numerals instead of "regular" numbers. Here's the original code to display normally:

I thought an easy way to change it (and the book didn't really explain a lot in this chapter) was to just use some if--else like so:

But after doing that the clock still shows arabic numerals only without a zero before single digits since I removed the if (i<10) part.
Please forgive me for asking what I know must be a really stupid question to many of you.
Thank you for your help.
16 years ago