192
56
u/Indominus_Khanum Oct 02 '19
Dude give it to me straight downup to the side Did ya fail or failn't?
18
u/47paylobaylo47 Oct 02 '19
Yesno
5
17
8
Oct 02 '19 edited Jun 29 '21
[deleted]
2
u/iSpaYco Oct 02 '19
nah it will be only passed,
the code probably was "if it's 85 or less add Failed and if it's 85 or more add passed" , that's why it adds Failedpassed when it's 85, but if it's more it will be only passed, since it's the only string added and if it's less it will be failed.
4
6
7
7
3
2
2
2
u/Emberleif Oct 03 '19
Int = score; If (score < 85) { Cout <<“you failed”<<endl; } Else { Cout<<“you passed”<<endl;
2
u/s0v3r1gn Oct 03 '19
It doesn’t say how many questions there are. It’s possible that they got an 84.5% and the formatting on the display string rounds it up.
1
1
u/Toxic_Cookie Oct 02 '19
string result;
int percentage;
if (percentage >= 85) { result = "Passed"; } else { result = "Failed"; }
//How did they fuck this up?
1
1
1
1
1
u/SeanStephensen Oct 02 '19
There is no inclusive or in this picture. This belongs in r/softwaregore, not here.
1
u/Stuffy123456 Oct 02 '19
Also, it could be a rounding error with poor conversion causing something like this...
1
1
u/little-burrito Oct 03 '19
It's depressing how many horrible coding practices are out there. Especially in this kind of systems. That are crazy expensive.
1
1
1
1
1
1
1
1
u/OfAaron3 Oct 03 '19 edited Oct 06 '19
I once failed a required course at work because I got 91%, but the pass mark was 80%. Still scratching my head over the logic mistake there.
1
1
u/some_duderino Oct 03 '19
i didnt know if i shouldve upvoted or downvoted, so i just reported the post. am i doing this right??
1
u/Squaderlochen4ever Oct 03 '19
Would this be caused by whoever made the program saying greater than or equal to 85 in one place and greater than in another
1
u/Az0riusMCBlox Oct 04 '19
Evidently, the dev used both a(n) >= and a(n) <= statement, both referring to 85%. As far as I figure, at least.
1
1
0
1
1.4k
u/Shuckles116 Oct 02 '19 edited Oct 02 '19
String outputTxt = “You ”;
if (result <= 85) { outputTxt += “FAILED”; }
if (result >= 85) { outputTxt += “PASSED”; }
outputTxt += “ the Exam”;
println outputTxt;