Take coding exam (c++

>take coding exam (c++
>see answers today
>apparently 4/5 returns 0, not one
>with the addition of a few other mistakes, probably going to get a low A or a high B
>mfw

FUCK IT SUCKS BEING RETARDED

not as much as being banned for making off topic threads?

>mods
>on Cred Forums
Lol

Wtf your exams are easy if you fail that question and still get a A.

goddamn nigger, why would it return one?

>what is 4/5?
>C++ questions

kek

>4/5
>1
Goddamn OP are you literally medically and clinically retarded
Fuck if you were in my class I'll fail your ass right then and there
It's not even a matter of coding, but a matter of math

Yeah yeah I'm a goddamn retard, I know. However, my codes were good (I think) and that was most of the test I'm sure I didn't fail

I agree, but I can see myself making a retarded mistake like that as well, you just don't expect a question like that in an exam...

If I saw that in a math exam, I would think "How many times does 4 go into 5?", but if I saw this in a C++ exam, I would think "How does the compiler work?" (even if no specific compiler is meant)

Do these questions really belong a programming exam?

4/5 =.8 tho, why wouldn't it be rounded to 1

That was my thought process, "How many times 4 goes into 5?" ugh, I feel like shit right now, I deserve all these insults...

because integer division truncates it

Because C++ is a language by retards, four retards.

There's two types of marks people get in programming classes. As and Fs. You'll be fine, it was just a sloppy mistake.

Haha it's ok bro, don't worry about it

I've made some pretty embarrassing mistakes too, and I'm a senior developer with a pretty nice salary now.

Our brains think at a too high level, we can't comprehend retarded questions, we think it's a trick

That would be 4.0/5.0, not 4/5

>apparently 4/5 returns 0, not one
How could you get that wrong jeez

what the hell is the 4/5 question?

a function is going to convert it to whatever its return type is, so what the fuck is the question? unless you don't mean 'return' as in a function return.

and I'm almost certain the last compiler I used didn't round down on conversion to integer.

how much is - 4/5

I was a bit harsh, so I apologize.

Not him, but in my first semester C programming class it was mostly C's.
There were questions like in the OP too

Please refrain from posting hate symbols.

OP HERE WITH UPDATE

Got a 92, thank god my coding was solid, still disappointed tho, I'll have to make it up

good job though senpai

>get low a/high b
>whine like a faggot bitch
kill yourself, the class average for my last exam was a 47, you're fucking fine. Cool the autism and maybe you would have some friends

Not OP, but you know when you know everything and still not get a perfect score because of a stupid mistake like that. It feels terrible

Welcome to humanity take a seat

>suck at coding
>wrote a code on my phone so it can write any code I tell it to by whispering on the microphone
>get 100% every time
Get rekt, sheeps

>terrible

Yes, it's a tragedy. How will OP ever recover?

>programming classes

This sounds like the stupidest waste of time.

Just start working on a project and whenever you get stuck on something you google it and find the stackexchange thread where somebody had the exact same problem and had dozens of people provide solutions to it.

It's that fucking easy, you can do anything with the internet as your resource.

>4/5 returns 0, not one

Can someone please explain what this means to a non-coder?

You don't really learn about industry standards and efficiency of code that way

4 and 5 are ints and so cant have decimals and when operated the result gets trunked
4/5=0.8->0

For the sake of simplicity imagine that there are two types of numbers. Those with decimal places and those without. 4 and 5 are those without. Since we cannot use a number with decimal places to divide 4 and 5 we have to use the closest number with no decimal places to represent 4/5. It is 0

employers want proof you know it so you go get your BA to get proof you can code and know maths

C has integers (whole numbers like 1 2 3) and floats (numbers like 5.1 5.2 3.14159)
Note that 5 is an integer and 5.0 is a float, even though they represent the same number, just because it has a dot in it.
If you do 5.0/2.0 the result is 2.5
But if you do 5/2, the result is 2 (with a rest of 1, but that is discarded)
if you try to do 4/5, you get 0. (with rest of 4 that is discarded)
Why would it be 1? No idea, maybe OP thought it would round to the nearest whole.

>It's a computers for business students subject

and it's random that c++ chose 0 and not 1?

see

no, it takes the floor of the decimal

if you think cs101 is hard

your going to have a rude awakening, you need to study a large portion of your life away i hope you understand why programmers look/act/feel a certain way

this was such a cunt after i used matlab for the longest time and needed to write code in c++ for the first time in 5 years. that as well as indices starting at 0 frustrated the fuck out of me in the beginning, but past that it wasn't so bad,

>"""(((>>>coding

matlab... noobfag got scared by his first real program

everybody googles the details from stack overflow, but you should know what you're doing or your program will end up being complete shit

>fail to understand how the basic operators work
>still get a low A or a high B
Your program sucks. Your school sucks. You suck.

Not really, try the function double f() { return 4/5; } This returns 0.0 because the integer division is done before the conversion from int to double.