Credit Card Checker

This is the perfect exercise to prompt me to ask this question of the community. When I get to this area of projects, I get a bit defeated and wonder if I should continue. See The code part of this problem, I am pretty sure I can figure it out, it is understanding HOW to solve the problem in the first place that confuses me.

I read about the Luhn algorithm, and honestly, I do not understand that, hence I do not even know how to begin to solve the problem. I have always enjoyed math and those types of things, but I have used, read, or had to understand this kind of stuff in over 20 years (yes that ages me a bit).

So I guess I am asking those folks in the community who have more of a problem thinking and understanding the logic aspect what it is they do to improve this or what they do to understand that aspect of programming?

This was not an easy exercise to figure out where to start. Like you said, understanding how to solve the algorithm was a challenge in and of itself! I had to actually write out on a piece of paper kind of a blueprint of how to approach the exercise. And it was not an easy exercise so don’t let it discourage you! It is a learning process and some parts are easier than others, but stick with it and you will thank yourself. The worst that will happen is you get some error messages!

1 Like

Thanks! It is definitely a tough assignment. I appreciate the response and encouragement. Frustrated, but will take the time to attack this the way you did. I think a good topic they should put near the beginning of this class is how to properly plan out and then code a project, I am sure in the real world you, as complex as things are, you can’t just sit down and start coding. Again appreciate your encouragement.

1 Like

This was a tough one, but after watching some videos that clarified the Luhn Algorithm, I was able to finish the first function validateCred, took a couple of hours, of researching trial and error, and debugging but got it done!