Results 1 to 6 of 6
Thread: Need to look for only 5 and 10's
- 11-11-2009, 05:38 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 2
- Rep Power
- 0
Need to look for only 5 and 10's
I'm writing a program that gives awards based on years served, given the staff has been employed for 5, 10, 15, 20, etc. years they get a plaque with the number of years employed. anyone got any hints or tips on a method I could write which would compare/decipher whether or not the number is a 5's or 10's number.
-
Use the mod operator (%) to see if an int is divisible by 5. If so, then number % 5 will equal 0.
Much luck and welcome to the forum!
- 11-11-2009, 05:45 AM #3
Member
- Join Date
- Nov 2009
- Posts
- 2
- Rep Power
- 0
thanks much :)
- 11-13-2009, 07:11 AM #4
if ((yearsemployed % 5 == 0 )|| (yearsemployed % 10 == 0))
write plaque for yearsemployed
- 11-14-2009, 07:19 PM #5
Member
- Join Date
- Oct 2009
- Location
- Rotterdam
- Posts
- 52
- Rep Power
- 0
- 11-14-2009, 07:52 PM #6
no need for remainder 10
I realized the same thing as I was going to bed. the problem was I was over focused on his title 5's and tens. I am working on a huge prime number project. So I was going to sleep thinking duh? 10 is divisible by five. I am not a senior programmer but I do have alot of experience with j2se. so maybe I am a beginner. I am new to this forum stuff and I need to learn to think before I type. My apologies
what about the employees with 6-9yrs 11-14 etc maybe they should have plaques 5+yrs 10+...I think the people with in between years long term service to the company will feel spited.....but i don't work thereLast edited by aaroncarpet; 11-14-2009 at 07:55 PM. Reason: other thoughts


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks