Credit Card Validation Check digit, C/C++ Programming

Assignment Help:
Use 16 digit credit card numbers that contain 15 digits an 1 check digit. The format of the card number consists of the 15 digits followed by the check digit. The check digit is computed by adding the 15 digits and then determining what digit (0-9) would need to be added to that so the result is evenly divisible by 10. So you would need to first add up the first 15 digits and then find out which number you would have to add to make the end result divisible by 10. In the example, the first 15 digits added up equal 75 and the you would need to add 5 to give the end result 80 and 80 is evenly divisible by 10.



For example,




8546 9234 8771 452X




(X is the check digit)




Add up each digit:




8+5+4+6+9+2+3+4+8+7+7+1+4+2+5= 75




For this to be evenly divisible by 10, you would need to add 5 to make the total result equal 80. So the check digit or X would equal 5.




For this program you need to write two functions. The First function verifies that a credit card number is valid. Ignore spaces in the credit card number, but other non-numeric characters will result in the number being invalid as will fewer/more than 16 digits. Write a Second function that randomly generates a VALID card Number




Finally, write a main function that creates 10 randomly generated numbers and validates them. Next, allow the user to enter card numbers and have the program tell the user whether their card number is valid or not.

I am so lost please help

Related Discussions:- Credit Card Validation Check digit

Padovan string, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concate

File, how i can open a file

how i can open a file

When i throw this object, A: Depends. Might be "zero" Objects which are ...

A: Depends. Might be "zero" Objects which are thrown must have a publicly accessible copy-constructor. The compiler is permitted to generate code which copies the thrown object

Friend funtion.., Is friend function can be harmfull to make a secure progr...

Is friend function can be harmfull to make a secure program/sofware?

Explain structured programming, Explain structured programming The prin...

Explain structured programming The principal idea behind structured programming was as easy as the idea of "divide and conquer." A computer program could be regarded as having

Data structures, what are 3 conditions under which the sequential search of...

what are 3 conditions under which the sequential search of a list is preferable to binary search?

Described the difference among "new" and "operator new" ?, Described the di...

Described the difference among "new" and "operator new" ? A:"operator new" works such as malloc.

Recursive function, Write a recursive function recursiveMin that takes an i...

Write a recursive function recursiveMin that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the smallest element in the array. The f

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd