+ 1

Code Coach Test Cases

Has Anyone faced this issue that you solve the problem statement of code Coach but result says that one of the test cases has failed, which is hidden... I've solved a Code Coach problem, but out of 7 test cases, no 6 has failed and all others have cleared..Test Cases are hidden. You cannot see what input value SoloLearn has entered against which my code has not given the correct answer. Problem is that there is no way forward from here.. Anyone has any solution in this regard?? Thanks

28th Mar 2020, 9:04 AM
Khurrum Ahmed Khan
Khurrum Ahmed Khan - avatar
9 Réponses
+ 1
Khurrum Ahmed Khan , Thanks for your understanding friend 👍. Let me answer now. Not just some fixes but other suggestions as well. +1. In loop that starts on line 42 instead of checking for i! =0 you can directly initialize i to 1 like : for(int i=1;i<inputDataDec.Length;i++){ } +2. This code on line 45 saving +=(inputDataDec[i]) * 0.3m; can be replaced by saving +=inputDataDec[i]; we will multiply saving by that 0.03m at end no need to do that for each item seperately. +3. On line 51 change formula by saving *= 1.07m * 0.3; +4. code from line 55 to 59 is wrong. All you need is Console.WriteLine( Math.Floor(saving) ); Dont use truncate. You were close to solve this good job. 👍
28th Mar 2020, 10:32 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
They are hidden for a purpose. This is for stopping people from hardcoding all the cases. If you have tried solving a code coach problem and can't figure out what's wrong in it you can ask here. Don't forget to link your code
28th Mar 2020, 9:07 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
Please mention your code and relevant tag when you posting any post
30th Mar 2020, 7:07 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Omkar, Thanks for the reply. Plz check my code https://code.sololearn.com/clmLgDjMFNIb/?ref=app
28th Mar 2020, 10:10 AM
Khurrum Ahmed Khan
Khurrum Ahmed Khan - avatar
+ 1
It is Super Sale (Medium Level) Code Coach
28th Mar 2020, 10:11 AM
Khurrum Ahmed Khan
Khurrum Ahmed Khan - avatar
+ 1
bundle of thanks :)
28th Mar 2020, 1:50 PM
Khurrum Ahmed Khan
Khurrum Ahmed Khan - avatar
+ 1
Math.Floor and all your suggestions did the trick... All Test Cases Passed. Thanks Omkar :)
28th Mar 2020, 2:08 PM
Khurrum Ahmed Khan
Khurrum Ahmed Khan - avatar
+ 1
Khurrum Ahmed Khan , Welcome friend. Keep practicing 😊
28th Mar 2020, 2:08 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
0
Hey can I talk to you in inbox please...I need help!
28th Mar 2020, 9:05 AM
Tihsrah
Tihsrah - avatar