Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
February 26th, 2013, 01:40 PM
 TheMoessiah
Registered User

Join Date: Feb 2013
Location: Ireland
Posts: 3
Time spent in forums: 12 m 53 sec
Reputation Power: 0
Java Arithmetic Help (Student)

Hi All,
Got a question on a self assessment for college on Java arithmetic. They gave me the question and answer.. However, I get a different answer to what they're getting so wanted to know if any of you guys can see where or if I'm going wrong... It's one of those distance learning courses so I technically don't have a tutor to help....

The Question is:
Result = d % a * c + a % b + a

a = 4
b = 12
c = 37
d = 51

The answer they gave me is 119. The answer I get is 109. HELP!!!

#2
February 26th, 2013, 04:50 PM
 NormR
Contributing User

Join Date: Aug 2010
Location: SW Missouri
Posts: 3,580
Time spent in forums: 2 Weeks 3 Days 2 h 43 m 12 sec
Reputation Power: 347
Post your code. I get 119 by copying and pasting the statements and adding a few ;s etc

#3
February 26th, 2013, 05:01 PM
 Aurum84
Contributing User

Join Date: Nov 2012
Posts: 74
Time spent in forums: 3 Days 23 h 19 m 57 sec
Reputation Power: 18
((51 % 4) * 37) + (4 % 12) + 4
= 3 * 37 + 4 + 4
= 3 * 37 + 8
= 111 + 8 = 119

#4
February 27th, 2013, 10:08 AM
 bullet
Java Junkie

Join Date: Feb 2004
Location: Mobile, Alabama
Posts: 3,961
Time spent in forums: 1 Month 2 Weeks 1 Day 7 h 12 m 2 sec
Reputation Power: 1283
How do you get 109?

 Viewing: Dev Shed Forums > Programming Languages > Java Help > Java Arithmetic Help (Student)