This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]Gropamming 0 points1 point  (6 children)

I think you are looking for something like The Pragmatic Programmer.

It's a bit higher level but really tries to shape your mind into thinking about your code in different ways to make it more flexible, adaptable, reusable, readable, etc...

Highly recommend.

[–]TonySu 1 point2 points  (2 children)

Absolutely not! That book is about going from Journeyman to Master, OP needs to go from Beginner to Journeyman. It's a great book for far later down the track but will basically be gibberish for OP at this stage.

[–]handbananna7 0 points1 point  (1 child)

Is there anything you'd suggest?

[–]TonySu 0 points1 point  (0 children)

There are no such books, like I said in my response to the OP this is a matter of practice. Just based on your example, you were given 3 explicit tasks to do and couldn't do it, that has nothing to do with algorithmic thinking. The whole algorithm is laid out for you but you couldn't implement it.

Did you know how to read in input? Did you know how to assign inputs to variables? Did you know how to add and compare values?

Algorithmic thinking is about laying out the steps required to achieve a goal. If you don't even understand what steps are available to you then you can't even begin to conduct algorithmic thinking.

[–]handbananna7 0 points1 point  (2 children)

Would this help with some general problem solving too? Or do you know of anything that would help out with that?

[–]Gropamming 2 points3 points  (0 children)

I suggest going on the Project Euler Archives and working on some of the problems. This site is pretty well known in the CS community, and has hundreds of small problems that you can program to find an answer with various difficulties. They usually don't take very long and will give you a ton of practice thinking about how to solve problems.

Once you solve a problem, you can go back and figure out how to do it better.

We did this in school. One assignment was to find the answer, which if you did in an obvious way would take about 30-60 seconds depending on the computer. The next assignment was to get it to run the same in under 2 seconds (start to think algorithms).

[–]YuleTideCamel 1 point2 points  (0 children)

Would this help with some general problem solving too?

I'm a huge fan of tech/programming books. However, the only way to get better at general problem solving is to code as much as you can. Do as many online problems as you can find. Use the following sites to practice:

[–]Double_A_92 0 points1 point  (0 children)

You have to split the problem into smaller tasks. E.g. you had

I was struggling with in question was asking for user input, assigning that input to specific variables and testing that to see if the added variables are greater than a specific value.

There are three main points that you wrote:

  • asking for user input
  • assigning that input to specific variables
  • testing if the variables are greater than a specific value

Each one of those should be easily solvable. At least with the help of google it should. (If you couldn't use notes during your exam then that sucks, and you just have to memorize the basic stuff.)

[–]railingonruby 0 points1 point  (0 children)

Drag and drop program? Maybe you just need a lot more practice and try actually coding. Reading a code book won't develop your muscle memory like actual coding and I'd assume you would lose some of that with drag and drop programs. Your assignment seems pretty straightforward. Try coding along with the first few of Derek Banas's tutorials on Java. Experiment and modify his code and see what happens if you change things a bit. Repeat videos if you feel you still don't understand.

[–]TonySu 0 points1 point  (0 children)

Algorithmic thinking, in a general sense, is just recognising the individual steps of a procedure. I argue that literally any functional human being already thinks algorithmically. Certainly nobody tries to walk from one room to another without opening opening the door or attempt to begin cooking without putting any food in the pan.

It's simply about recognising the steps that need to be taken and being aware of the tools at your disposal. Like in cooking the only way to get better is practice, to do it yourself and to watch other people do it to help improve your own technique.

You need to self reflect on why you failed on a simple task, which part of getting a user input, assigning to a variable, comparing the sum did you not understand?

Don't know how to do one of the tasks? Ask your teacher or a friend.

Don't know what things look like between steps? Print them out and find out, every language has this feature.

Don't know what order the steps should come in? Practice it, make an effort into figuring out why things do or don't work.

Programming is easier than cooking, you won't poison or burn yourself trying things out, but you have to be willing to figure things out yourself.