Questions tagged [credit-card-number]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Cs50 pset1 problem credit

I'm not able to take out the second digit of the credit number, how to do it for large numbers like 16 digit,15digit,14 digit?
0
votes
3answers
839 views

Credit Problem: what does "number’s second-to-last digit" mean?

In the example code on for the Credit problem, it says, Multiply every other digit by 2, starting with the number’s second-to-last digit, and then add those products' digits together. Moverover, the ...
0
votes
1answer
70 views

Pset1 valid visa number as invalid

I built the first part to check whether a number is a valid AMEX number and used the same logic to check for Visa number but the codes don't seem to work as I tried with several valid visa numbers and ...
0
votes
2answers
60 views

Why does this code sometimes give me a different sum when i run it for the same cc number?

I'm working on the credit problem in pset1, and this is only part of what should be done. All I'm trying to do here is to multiply every other number (from the cc number entered by the user) by two, ...
0
votes
1answer
104 views

Why does my code not print every other digit in a long long, and add them together?

Why won't this code print every other digit in a long long number (in this case, it's suppposed to be a credit card number), and add these numbers up? You'll notice I commented out several lines of ...