
Credit Card Number Check
The last digit of a credit card number is the check digit which protects against transcription errors such as an error in a single digit or switching two digits. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for the numbers with 8 digits instead of 16.Starting from the rightmost digit, form the sum of every other digit.For example, if the credit card number is 43589795, then you form the sum:5 + 7 + 8 + 3 = 23.Double each of the digits that were not included in the preceding step.Add all digits of the resulting numbers.For example, with the number given above, doubling the digits, starting with the next to last one, yields 18 18 10 8.Adding all digits in these values yields 1 + 8 + 1 + 8 + 1 + 0 + 8=27.Add the sums of the two preceding steps.If the last digit of the result is 0, the number is valid.In this case, 23 + 27 is 50, so the number is valid.Write a program that implements this algorithm.The user should supply an 8-digit number and you should print out whether the number is valid or not. If it is not valid, you should print out the value of the check digit that would make the number valid.Allow the user to enter as many 8 digit credit cards as wished.SAMPLE OUTPUT:Enter eight digit number =>123456784 check digit would make credit card number valid___________________________________Another credit card check, press 1 for yes =>1Enter eight digit number =>12345674Credit card checks out – verified___________________________________Another credit card check, press 1 for yes =>1Enter eight digit number =>435879575 check digit would make credit card number valid____________________________________Another credit card check, press 1 for yes =>1Enter eight digit number =>43587955Credit card checks out – verified____________________________________Another credit card check, press 1 for yes =>2———————————————————————————–
Point Distribution:
-50 Does not compile
-5 Warnings
-5 No description multiple line comments (name, date, etc)
-10 No single line comments (logic, input, output, etc)
-10 Does not allow the user to enter as many 8 digit credit cards as wished.
-20 Does not print out whether the number is valid or not.
-20 Does not print out the value of the check digit that would make the number valid. (If the number is not valid).
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post i-need-c-code appeared first on Essay Fount.
What Students Are Saying About Us
.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐"Honestly, I was afraid to send my paper to you, but you proved you are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"
.......... Customer ID: 11***| Rating: ⭐⭐⭐⭐⭐
"This company is the best there is. They saved me so many times, I cannot even keep count. Now I recommend it to all my friends, and none of them have complained about it. The writers here are excellent."
"Order a custom Paper on Similar Assignment at essayfount.com! No Plagiarism! Enjoy 20% Discount!"
