Question: For this error, I have been told that the output for the following attached input case (testMax4.txt) is wrong but I really can't see why.

For this error, I have been told that the output for the following attached input case (testMax4.txt) is wrong but I really can't see why. I know I have numbers that are larger than the previous cases but they are all integers. Correct this code for me and report the answer below.

HINT: It might help to create a similar test case with similarly large integer values and see what is output and compare it to what you know the answer should be. It might also help to output the return value of computeSum for your test case, similar to how error 2 was addressed. Perhaps you'll spot an error there.

testMax4.txt

11 38 20297301 203792055 470920265 -478704681 151405202 60838178 -32857738 -344687259 -265626813 533184364 169541383 317082028 -332709991 523369382 424139055 -439110297 304906412 -276308489 395036969 -96487814 -338331876 -113649151 -370945045 -93663970 -514021014 -58095516 482460298 -438600137 -408810284 428541529 -303733203 -328539966 213101284 412183933 -117710425 -265334679 532862369 -47462991 117158579 225343288 335557705 126612243 111531217 467730537 313496270 352797233 209713081 -39492003 -190251568 -528985033 -6200457 459566501 -183806638 -389788317 -429145044 -243204292 247275517 -222214278 207796064 -254397482 -149223153 173681265 -462908165 27361875 -293596451 -315871951 508857835 367272783 -104191990 -518234004 -474097074 15064018 524178759 531088818 -275164842 -457932500 -136669764 286692482 176317634 262055900 416791578 -245141610 266213877 131927973 -25386433 -441357245 -434750796 -502956347 -99849853 146271736 127178618 144367166 455882140 -323389469 378131831 -214333103 372862004 -360008013 277406250 -409214452 -481287419 419505274 -533215592 -450732807 -439220561 49596584 -328715222 97211896 -323443689 301381181 7718179 414851112 -444424581 420874742 -9598280 -5119232 -189137899 128404165 -102620458 425719418 -527805588 -467784127 118042477 -15036306 239092530 -121117872 -126703247 150189310 125320925 263464171 167258485 -338854875 -36087356 310212347 -318119961 295427697 219765493 -100331683 -119499039 223435473 -313392236 -272823035 335001516 -46733433 268702184 367247167 -467145261 482656312 388180747 3989264 23765478 -241646813 399406381 528596154 -312990261 -150982801 -192131966 84902750 175508669 -204097891 -509862710 -93662019 -267859740 340914973 400034172 455221014 -252491633 -67406341 -531583346 462171956 132181262 -465257030 -286792732 -101277568 471979313 230262842 -246149805 305130832 384243035 -385740334 -255581870 521339204 529274681 -107351166 393556027 385241031 15989548 -285117886 -208873918 348033200 492139827 495661428 303604209 -695031 -155369591 47536761 382277984 482756079 -256451357 -224629921 528459760 357056400 -460520376 268893880 280059583 102832721 17739914 -252903803 -443215436 24556562 -430215839 -518925230 61995807 376269705 -443999197 300959835 491565066 -46227509 77531683 162521581 201510692 -161454614 486920866 -62473529 -247303096 510113462 -221698441 432527293 -204399965 -94341465 226505527 -343066528 149305225 493541845 302187552 275640270 -283609130 -291256803 31381128 -240928592 -165598724 -170527387 409009147 -477587908 -421003610 4962816 -189824010 -32754573 -335418867 -109746389 -295663807 298441072 -160395299 -216629330 -504066333 -350037543 161235901 107736232 438710465 432972398 182012026 224370277 432577504 -401569600 485070803 209852776 -376410583 441758979 427236576 38310278 -516043267 -243755269 236383007 -300526289 -103521987 211318803 379886618 -469603634 377314313 -368911219 -464675398 221667914 -50757347 -83130924 35052322 240221349 147623366 117639150 161729099 -41194557 -215405696 196412429 -64190437 58985548 79438127 -325174716 478235967 534879147 -144237060 -290667434 -363584115 -466285519 -127461437 -1053781 -110726127 473184594 -51914948 -29217699 -146379342 -61612520 189131694 -456190099 -123644797 55005068 -338042807 528475674 -160309848 369761646 280702240 267694154 -534852640 418896618 -233374268 -153266144 -527144778 490238338 471762814 224681136 35923521 -460619770 366102823 235857359 35672982 476276673 -257216856 370703108 -295801400 -462894667 -436719095 352712602 178861983 -32942592 257340472 252866007 -78356003 -423563435 93677402 -112080056 -147444194 58344624 3491014 252719153 48764532 282338051 87664801 -466482132 267789186 208331046 -458207972 256389578 -181060785 177825753 116096835 147600241 -462204247 412841949 -478902397 -156468406 -507966666 347271228 115466171 152350804 402843672 520877738 379351294 -27911535 122741562 45614091 349745891 421320799 -355611331 -329910515 272377482 14276329 -532905478 -335712530 259344173 -308895822 -93348940 -203042719 152283742 493301076 -135205156 -517638519 214936033 -343992000 -137840514 501985830 -523464410 -223177534 -450295472 350247111 148236389 -67059958 104896334 503170621 -20441261 348916316 54575121 -362393072 -203540100 415138405 -480959050 75782955 505585219 69395891 -91754395 72625042 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!