[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
halo /g/ I did every question except #3 pls halp
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 21
Thread images: 2
File: IMG_20160309_010349.jpg (3 MB, 3264x2448) Image search: [Google]
IMG_20160309_010349.jpg
3 MB, 3264x2448
halo /g/
I did every question except #3 pls halp
>>
Uh... C = (F - 32)/1.8; or C = (F - 32)/1.8f;
What's hard about that?
>>
C = (F. - 32) / 1.8
The . after the F casts it to a float, which is required here.

Didn't they cover casting yet?
>>
>>53389763
Casting it to float is unnecessary. 1.8 is already double and 1.8f is a float literal. Given only int/int division truncates, (F - 32)/1.8 is perfectly valid.
>>
>>53389798
I was hoping to be first and have him submit it as the answer and get it wrong so that he decides to not make these threads in the future
>>
>>53389838
Sorry, I was foolish.

>>53389705
Disregard what I said until now. The answer is (float) (F. - 32.000f) / (double) 1.8.
>>
File: IMG_20160309_013517.jpg (2 MB, 3264x2448) Image search: [Google]
IMG_20160309_013517.jpg
2 MB, 3264x2448
>>53389980
modern universities everybody
>>
>>53390100
Honestly, go somewhere else.
>>
>>53390100
It's not like a professor wouldn't give you points back for that.
>>
>>53390111
>mug /g/
>>
>>53390141
I'm not trying to tell him to leave /g/ or this thread, but the university that can't into parsing decent lines of code.

Just get rid if the whitespace first, it's not a problem.
>>
>>53390141
I think he was talking about the uni.
>>
>>53390165
my bad then
>>
>>53390141
He was saying find a new university so you actually learn something, but you might as well stay seeing as it fits your level of intellect.
>>
>>53390217
>there's only one correct way of interpretation
also
>implying in going though uni for the educational value
>>
>>53389705
it's literally covered in K&R
it's the first fucking program in the book
>>
How is that arithmetic expression of equality in #2 expressed by an assignment statement?
Shouldn't it be
z == (x + y) * w
>>
>>53391248
it doesn't say it's testing equality
I'd assume it's meant to be assignment
>>
>>53391299
That doesn't make sense mathematically though
>>
>>53391248
I think it would be called a statement rather than an arithmetic expression, if the teacher wanted the students to use logical operators.

"the statement 'z = x + y' can be written in C as...?", for example.

In Algebra, "z = x + y" just states a relationship between variables/values, and since that can't be applied in real time in C or most programming languages, you have the student assign the value x + y to the variable z.

I'm probably looking at it the wrong way, but there's no need to overthink this since it's an introductory exercise.

>>53391203
OP's only source for help is /g/. You think he'd even ask his professor? Wait until the next thread where he says "halo /g/ my teacher said main should return 0, but what about EXIT_SUCCESS?".
>>
>>53390100
Bring it up with your department chair. That's ridiculous. They need to get a refund if they paid for that website
Thread replies: 21
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.