Struggling with C++ Programming—Looking for Tips and Advice

0
10
Asked By CaffeineFreak42 On

I'm a first-year computer science student at BarcelonaTech, and I'm doing well in most of my classes like physics and math, but I'm really struggling with programming. We're learning C++ from scratch, covering concepts like loops, recursion, vectors, arrays, and algorithms. Unfortunately, my first midterm didn't go well—I scored a 1.7 out of 10, and only about 10% of the class passed. With finals coming up in just over two weeks, I'm feeling overwhelmed. When I prepare and try to code, what should take me 30 minutes often turns into hour-long debugging sessions, and it feels like the course is geared toward those with prior experience. I'm looking for tips to help me translate my thoughts into code and make debugging easier (we use VS Code). Also, any advice on mindset and mindfulness that could help would be appreciated!

4 Answers

Answered By CaffeineFreak42 On

I’d say I’d start with a function that takes an integer, and I’d include a base case returning the integer if it’s one. Otherwise, I’d do something like add the number plus a recursive call to the same function with the number decreased by one. So it would look like this in an outline: x + Radd(x-1). What do you think?

Answered By CodeCrusader88 On

Debugging can be super frustrating, especially when you're eager to see your code work after putting in a lot of effort. I try not to expect my code to run perfectly the first time or assume I'll immediately know where the errors are. Taking on debugging as an exciting process can actually turn things around. Sometimes, you might just be missing a simple semicolon, and other times, the issue could be a structural mistake. Patience is key! Try not to write too much code before testing your program or algorithm, even if it means things aren’t fully done yet. It helps keep your motivation up, especially when you’re coding something you’re genuinely interested in!

Answered By LogicMaster78 On

Honestly, it sounds like your situation is more about the teaching approach than you. With only two weeks until finals and the midterm passing rate being so low, it seems like the class structure could be better. It might be more helpful to address your instructor's methods or lack of support when it comes to debugging, rather than just focusing on your performance.

Answered By DebugDynamo29 On

I can't really help you with turning thoughts into code since it's very personal, but here’s a little challenge. Describe in words how you would implement a function to calculate a recursive addition (like recursive factorial). For instance, for Radd(5), you want to come up with 5 + 4 + 3 + 2 + 1 = 15. Try to describe your thought process step-by-step. Even the parts you think won't work—just let it flow! That should give you some clarity on how you're thinking.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.