I'm taking intro to computer programming, and we're learning c++. At first, I thought it was going to be an easy class; the concepts seemed simple enough. However, over the last week, the difficulty has kind of ramped up. We're now going over functions and series, and I feel like I'm way over my head. I mean, I understand the code, but when I have to code something, I don't know what to do.
How do I git gud? I gave a fucking test on monday, and I have 3 days to unfuck my shit
Considering it Well my professor wanted us to calculate values for cos(x) using its maclaurien series, and we had to use for and while loops to do it. Honestly I'm still a bit confused on how to do it...
William Lopez
Programming is easy just fucking kill yourself already
Camden Jenkins
>retards that don't understand basic calculus concepts lmao
Joseph Lewis
Thanks for the support famalam, appreciate it
Chase Price
Codecademy. Do the python course in a day. Easily pass your test.
Sebastian Cox
No problem, now drink the bleach
Eli Wilson
Take it easy man. Programming is easy after you've fully grasped the concept of its parts. At first it starts easy with for/while loops and stuff and then you get into private/public classes and friends and polymorphism and the shit is super confusing until you can finally wrap your mind around it and after that its all a walk in the park.
Lincoln Walker
Read the fucking textbook and do some exercises? You can apply this advice to anything you have to learn in uni
Sebastian Long
That's cause you probably had a Calculus 2 prerequisite. Where they teach maclaurien series
Jaxson Torres
I don't have time tho, I got a bunch of homework plus another test on Tuesday I got to study for. Hopefully, man. Literally going to do that after I finish my calc homework. Nah, I'm in calculus 2 right now so that can't be it. I took BC though so I'm not totally in the dark, but I feel bad for the people taking calc 1 and doing this stuff
Jaxon Nguyen
>Calc 2 >College
Luis Sullivan
The fuck high school did you go to that teaches calc II? That is not a common goddamn thing.
Leo Jones
It's probably some sperg that thinks he's hot shit for taking BC and getting credit for it
Jonathan Price
Seems like you've never worked on s real world project
That shows you how to calculate cosine using a maclauren series.
As far as writing the function, I'm not going to walk you through that because it's extremely basic shit. Ask your professor for help. This isn't high school, profs are actually there to teach you. I will tell you that you need to call a function that has a decrementing for loop.
Thomas Watson
If Calc 2 is not a prereq then they *should* explain how the maclaurin series works in this case.
TIP: Group like so: (a - b) + (c - d) + (e - f) + ...
Cameron Watson
Damn. I thought I was an underachieving retard but at least I wasn't like this. Thanks OP.
Jonathan Davis
int ft_fibonacci(int index) { if (index < -1) index = -1; if (index < 2) return (index); return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2)); }
Fibonacci in C, recursion helps for series. I have an iterative exemple for the collatz conjecture if you want.
Charles Stewart
Holy fuck man, just googled that shit, looks pretty awful. Now i remember why I went into IT.
Angel Brooks
If you score well on the ap you can place out of calc 1 and 2 retard
Josiah Lewis
>functions and basic control structures are difficult Just get a job at McDonald's or something like that.
Jace Davis
CS graduate here. I fully hate the concept of tests and think it is absolutely cancerous for computer science specifically. I went through my entire undergrad programming minimally and just memorizing for tests. This is so fucking bad for CS you wouldn't believe it, Jesus Christ. And you pretty much have to do it this way because tests are worth so much. To me it was " do I write this program which will take an indeterminate amount of time possibly fucking me over for the test, or do I just study for the test that I'm guaranteed to learn most of".
Fuuck that was so stupid, thank god its over.
Jackson Ward
>doing Fibonacci recursively That's some bogosort-tier shit. Iterative solution is shorter, easier to understand AND faster.
Juan Roberts
bump
Henry Williams
But at least you have a piece of paper which will raise the chance of being employed in an IT field. Why do I have a feeling that everything outside natural sciences in universities is a God damn Ponzi scheme?
Wyatt Brown
Learn the habit of taking concepts and putting them in code basically.
It sounds like what you want is practial exercises.
I can recomend /r/dailyprogrammer for fun exercises with problems often derived from other sciences to make it more interesting.
Also, dont worry about it, just keep pushing forward, it takes time to learn.