wood burning stoves*
The moose likes Beginning Java and the fly likes I know its Friday night, hope somebody's here! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I know its Friday night, hope somebody Watch "I know its Friday night, hope somebody New topic
Author

I know its Friday night, hope somebody's here!

Ryan Newcombe
Greenhorn

Joined: Oct 02, 2002
Posts: 24
I have a problem with my second case in this program, my totals are all 32. How can I solve this!?

[ October 04, 2002: Message edited by: Marilyn de Queiroz ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Have I seen this before?
Like over here?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ryan Newcombe
Greenhorn

Joined: Oct 02, 2002
Posts: 24
Close, but not the same---still does not help with my problem.
I'm sure we have the same class together but I don't know the person.
A little help would be appreciated.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Why are you guys initializing your numeric constants to single chars?
Try doing this instead:
totalotPay = 0;
totalRegPay = 0;
totalGrossPay = 0;
counter = 0;


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
By the way, I just wanted to add that you two guys are asking your questions in exactly the correct way. Show us that you are trying to do the work and we will be more than happy to give you a guiding hand.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
That's why I referred you to over at the other
question. He initialized to '0' and got 48 which
is the value of the char '0'.
You are getting 32 which is the code for ' ', a blank.
-Barry
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
And you are re-initializing your counter to ' ' everytime you start the "I" case. Try getting rid of the counter=' ' from the start of the case.
Ryan Newcombe
Greenhorn

Joined: Oct 02, 2002
Posts: 24
Thank You for your help guys. I did what you said and it worked for the transaction total but the regular pay, gross pay, and ot pay are not adding up. any suggestions?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
It looks like you aren't adding anything to them.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
The program ends in midair too. Or at least seems like it.
I would be interested to see the assignment as defined by the instructor. Can you post it somehow?
And I would like to see the instructor's solution when the assigment is over.
[ October 05, 2002: Message edited by: Barry Gaunt ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I know its Friday night, hope somebody's here!
 
Similar Threads
confusion.
Alright, my eyes hurt from staring at this monitor trying to figure this out.
I am a true green horn
payroll
DUE AT MIDNIGHT TONIGHT..1 ERROR..HELP