Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON (pycharm) - credit card check application Credit card companies typically assign a special digit, called a check digit, to the end of each customers

PYTHON (pycharm) - credit card check application

Credit card companies typically assign a special digit, called a check digit, to the end of each customers credit card number. The check digit allows companies to verify that the credit card number was entered accurately. The following method is used to verify actual credit card numbers but, for simplicity, we will describe it for numbers with 8 digits instead of 16:

Starting from the right most digit, form the sum of every other digit. For example, if the credit card number is 4358 9795, 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 our case, 23 + 27 = 50, so the number is valid.

Create the Credit Card Check Application. The application should implement the above algorithm. The user should supply an 8-digit number, and you should print out whether the number is valid or not. The program output should be formatted as shown in the Sample Run.

Note: You must use at least one for loop in your code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

Question What are the requirements for a safe harbor 401(k) plan?30

Answered: 1 week ago