reset password
Author Message
jpascua
Posts: 197
Posted 14:01 Feb 04, 2015 |

I'm wondering what you guys got for an output. I feel that my algorithm is right, but not all my outputs seem correct. Is it just me?

Sums:

-4 lbs 6 oz
8 lbs 1 oz
-4 lbs 10 oz
30 lbs 10 oz
-3 lbs 12 oz
8 lbs 4 oz
17 lbs 11 oz
25 lbs 3 oz
26 lbs 8 oz
-21 lbs 14 oz

Differences:

0 lbs 0 oz
1 lbs 3 oz
-9 lbs 12 oz
-11 lbs 12 oz
7 lbs 14 oz
0 lbs 0 oz
-17 lbs 11 oz
16 lbs 5 oz
0 lbs 0 oz
0 lbs 0 oz

Equalities:

true
false
false
false
false
true
false
false
true
true

 

 

jwarren6
Posts: 56
Posted 14:11 Feb 04, 2015 |

   Sums:
-3 lbs, -10 oz
8 lbs, 1 oz
-4 lbs, -4 oz
30 lbs, 10 oz
-2 lbs, -2 oz
8 lbs, 4 oz
18 lbs, 3 oz
25 lbs, 3 oz
26 lbs, 8 oz
-18 lbs, -2 oz

   Differences:
0 lbs, 0 oz
1 lbs, 3 oz
-9 lbs, -6 oz
-11 lbs, -12 oz
6 lbs, 4 oz
0 lbs, 0 oz
-17 lbs, -3 oz
16 lbs, 5 oz
0 lbs, 0 oz
0 lbs, 0 oz

   Equalities:
true
false
false
false
false
true
false
false
true
true

This is my output but it really comes down to how you treat something like -2 lbs 3 oz...is it -2 lbs -3 oz or is it -1 lb -13 oz?
because -2 lbs 3oz = (-1 lb -16 oz) 3 oz = -1 lb (-16 oz 3 oz) = -1 lb -13 oz.

Last edited by jwarren6 at 14:14 Feb 04, 2015.
se1k1h1mawar1
Posts: 121
Posted 22:04 Feb 04, 2015 |
jpascua wrote:

I'm wondering what you guys got for an output. I feel that my algorithm is right, but not all my outputs seem correct. Is it just me?

Sums:

-4 lbs 6 oz
8 lbs 1 oz
-4 lbs 10 oz
30 lbs 10 oz
-3 lbs 12 oz
8 lbs 4 oz
17 lbs 11 oz
25 lbs 3 oz
26 lbs 8 oz
-21 lbs 14 oz

Differences:

0 lbs 0 oz
1 lbs 3 oz
-9 lbs 12 oz
-11 lbs 12 oz
7 lbs 14 oz
0 lbs 0 oz
-17 lbs 11 oz
16 lbs 5 oz
0 lbs 0 oz
0 lbs 0 oz

Equalities:

true
false
false
false
false
true
false
false
true
true

 

 

I have the exact same calculation results as yours.
Good luck on your midterms to all of you!