The Student Room Group

Need Advice.

Hi,
I am computer science student first year studying in London. I have been struggling with programming, I go to every lecture and still finding it hard to understand. Is there any advice you can give that can help me understand and solve problem. I'm studying C programming language.

Thank you.
Original post by leobarry
Hi,
I am computer science student first year studying in London. I have been struggling with programming, I go to every lecture and still finding it hard to understand. Is there any advice you can give that can help me understand and solve problem. I'm studying C programming language.

Thank you.

Best way to solve any problem is to separate the task into several pieces. After that, think how you can resolve the task linearly (one step after another), or in some instances, multiple at the same time if you use threading.
Original post by leobarry
Hi,
I am computer science student first year studying in London. I have been struggling with programming, I go to every lecture and still finding it hard to understand. Is there any advice you can give that can help me understand and solve problem. I'm studying C programming language.

I would take some time to go back to earlier material from previous lectures - the stuff you're being given in each lecture is probably going to be dependent on understanding everything that you studied in the first couple of months, so you might have managed to fall behind a bit and it's now having a cumulative effect on making it harder to keep up.

If you revisit your notes and exercises from those previous lectures then make sure you're comfortable with all of those, that might help you get a better understanding from the more recent stuff. Maybe there are some concepts or parts of the C language which you only glossed over briefly first time around and missed out some important detail about what things do and how they work. Perhaps some exercises that you skipped or didn't feel entirely confident with, so those would be worth revisiting

For problem solving, whenever a problem looks too difficult, don't try to solve the whole thing at once - identify the smallest, simplest possible part of the problem and start with getting those to work on their own (maybe in separate programs).

1.

Identify the smallest, simplest possible part of the problem and start with getting those to work on their own (maybe in separate programs).

2.

Write out an example of the smaller problem by choosing some simple input/data to start with (e.g. small numbers, short arrays, short strings, etc), following through the manual steps one at time. (i.e. starting by solving the problem just for one specific case - not for a general case yet)
For example, this where the lecturer explains a searching algorithm using a small array of numbers - https://www.youtube.com/watch?v=5azaK2cBKGw&t=1430s

3.

Write those steps out on paper in their logical order until you start to see patterns in those steps where some or all of them are essentially repeating the same steps but with different data/numbers/etc

4.

Look for patterns in the steps you've written down, and consider how to apply programming constructs (such as Variables, Arrays, If/Else, For/While, etc.) to express those patterns in a more general way. Remember that if you can get a bit of logic to do something once, then getting it to happen many times is a matter of combining it with a loop.

5.

Write out the generalised 'algorithm' on paper using those programming constructs, then trace it through by-hand to check it matches the same logic you started with.

6.

Translate it into C code and run the program using the same input you used for the hand-written example to test that it gives you the same output. If you're having trouble with the C syntax or compiler errors, you should be able to find loads of examples on Google.

7.

Go through the process again with a more complicated example input; going back through the same process to figure out what the steps should be in a logical order, and looking for the patterns again.



Here's a few decent C resources:

https://www.youtube.com/playlist?list=PL6gx4Cwl9DGAKIXv8Yr6nhGJ9Vlcjyymq
http://c-faq.com/
https://en.cppreference.com/w/c
https://www.coursera.org/learn/programming-fundamentals (Can unlock all the material for free by choosing 'Audit' - ignore anything which asks you to pay)
Reply 3
Thanks for your replies

Quick Reply

Latest

Trending

Trending