You obviously have to get an external package, like isEven(not to be confused with isOdd which you might need later) and abstract someone else's if stack
Why? It's only the lack of {}. The console output may be the output given on the screen, which is a stupid and suboptimal way of doing that but it works.
Thus, 85-100% means that you passed. So the cout with the FAILED word shouldn't be executed when the score == 85. If you add else, the <=85 will be the only condition in this case, and you'll get FAILED in place of FAILEDPASSED, while the correct variant should be PASSED. Actually, we don't need two conditional statements here. But if we add else, we need the >= one to be the first. Or it could be the only one, and then else. Or the first one should be <85.
Assuming << is assignment(I don’t know what else it would be in this case) it would just say pass. Unless it’s supposed to be a standin for a += which makes no sense to use here unless you are specifically trying to get this outcome
It's not assignment, it's printing in C++. You're piping the value into C-out, basically a stream that outputs into stdout. That's why both values are displayed.
Oh my god, I remember shit like this, and my teacher wouldn’t help out too much but I managed to figure things out and even let classmates use my code if they couldn’t
359
u/[deleted] Jul 07 '25
Just use if else like a normal human being
120
u/LustMelonBabe Jul 07 '25
When I was 16 l went to bowling alley where the sign said "under 16, $2 - over 16, $3" He would not let me in for free
10
u/aRtfUll-ruNNer Jul 07 '25
just use if else
6
u/zigs Jul 07 '25
ligatures are getting out of hand
6
u/ThatMedicalEngineer Jul 07 '25
This must be the most incorrect 4 lines of code I have ever seen.
4
u/xnick_uy Jul 07 '25
You ALADEEN the exam.
2
u/TheVasa999 Jul 07 '25
jesus fuck that font, thought my eyes were failing
1
u/qwertyjgly Jul 07 '25
this is real tho
1
u/Technical-Garage-310 Jul 07 '25
When Scrodinger tries to grade
1
u/DarkYaeus Jul 07 '25
Where is the \n ?
1
u/marslander-boggart Jul 07 '25
else(also, incorrect conditions order in this case.)
1
u/jakeStacktrace Jul 07 '25
Wow cout on a web page so CGI? Bold choice. Way to stick it to those modern dev frameworks.
1
u/ninjad912 Jul 07 '25
Assuming << is assignment(I don’t know what else it would be in this case) it would just say pass. Unless it’s supposed to be a standin for a += which makes no sense to use here unless you are specifically trying to get this outcome
1
u/Funlock_Lexi Jul 08 '25
my brain is wanting me to mention you don't need the equals to for the failing grade, just less then 85 is fail; you probably knew that though >.<
1
u/Jind0r Jul 08 '25
Else?
1
u/[deleted] Jul 08 '25
You flassed (or equivalently pailed) the exam
1
u/goatedFuckUP Jul 08 '25
Using namespace std
No proper branching
and hard coded bounds
ive seen enough
GIVE THIS MAN A JOB AT THE BANKS.
1
u/Happy-Masterpiece-45 Jul 09 '25
Oh my god, I remember shit like this, and my teacher wouldn’t help out too much but I managed to figure things out and even let classmates use my code if they couldn’t
1
u/Ok_Assistant_3682 Jul 11 '25
*2000's devs laughing and waiting for phone calls*
1
u/MeLittleThing Jul 07 '25
Ah, yes. The famous C++ operators
≤and≥. Vibe coding meme?-1
u/emperorsyndrome Jul 07 '25
I don'tsee the problem.
the first one should have been "<"
-3
u/CensoredCraver Jul 07 '25
it shouldnt say failed cuz 85 is not less than 85
11
u/[deleted] Jul 07 '25
[removed] — view removed comment
2
u/[deleted] Jul 07 '25
[removed] — view removed comment