• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modulus Operator

 
Shirl Diva
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone give me some insight on Java's modulus operator? If I have code that calculates the interest on the principal amount, why can't I get
the remainder for the division ( I am using all integer values) statement. I am new to java and have been grasping at straws a bit. I seem to be able to get the first digit but not the second one - for the cents. On second thought, can you take a look at the code and let me know where I'm going wrong:

Maybe I don't really understand the modulus operator. I thought that you could divide
2 integers then use the same two to get the
remainder. Please help.
Shirl

Marilyn added code tags.
[ October 31, 2002: Message edited by: Marilyn de Queiroz ]
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1820
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Closing thread in IDEs and moving to Java in General (Beginner).
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where is the modulus operator in your code???
Jamie
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This page might help explain modulo.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic