Cody

Solution 1809705

Submitted on 8 May 2019 by kirti singh
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
a = {'$12,001.87','$0.04','$103,887.55','$0.32'}; b = 115889.78; assert(abs(moneySum(a)-b) < 1e-4)

p = 4 q = '$12,001.87' w = 10 v = '1' v = '12' v = '12,' v = '12,0' v = '12,00' v = '12,001' v = '12,001.' v = '12,001.8' v = '12,001.87' f = '12001.87' v = 0×0 empty char array x = 1.2002e+04 q = '$0.04' w = 5 v = '0' v = '0.' v = '0.0' v = '0.04' f = '0.04' v = 0×0 empty char array x = 1.0e+04 * 1.2002 0.0000 q = '$103,887.55' w = 11 v = '1' v = '10' v = '103' v = '103,' v = '103,8' v = '103,88' v = '103,887' v = '103,887.' v = '103,887.5' v = '103,887.55' f = '103887.55' v = 0×0 empty char array x = 1.0e+05 * 0.1200 0.0000 1.0389 q = '$0.32' w = 5 v = '0' v = '0.' v = '0.3' v = '0.32' f = '0.32' v = 0×0 empty char array x = 1.0e+05 * 0.1200 0.0000 1.0389 0.0000

2   Pass
a = {'$0.02'}; b = 0.02; assert(abs(moneySum(a)-b) < 1e-4)

p = 1 q = '$0.02' w = 5 v = '0' v = '0.' v = '0.0' v = '0.02' f = '0.02' v = 0×0 empty char array x = 0.0200

3   Pass
a = {'$81.47','$12.69','$91,337.60'}; b = 91431.76; assert(abs(moneySum(a)-b) < 1e-4)

p = 3 q = '$81.47' w = 6 v = '8' v = '81' v = '81.' v = '81.4' v = '81.47' f = '81.47' v = 0×0 empty char array x = 81.4700 q = '$12.69' w = 6 v = '1' v = '12' v = '12.' v = '12.6' v = '12.69' f = '12.69' v = 0×0 empty char array x = 81.4700 12.6900 q = '$91,337.60' w = 10 v = '9' v = '91' v = '91,' v = '91,3' v = '91,33' v = '91,337' v = '91,337.' v = '91,337.6' v = '91,337.60' f = '91337.60' v = 0×0 empty char array x = 1.0e+04 * 0.0081 0.0013 9.1338