The Luhn algorithm is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Identifier numbers, ... etc. Write a program in (C++/Java) and Python that reads the text file "CreditCards.txt" and validate each credit card number using Luhn algorithm described below. The program should generate a report displaying the following information on the console: Credit Card 4532971700336820 1 2 5163611731527401 Type Visa MasterCard John Smith After implementing the above program, which programing language would you prefer (C++/Java) or Python? Why? 101BANK CREDIT CARD 4137 8947 1175 5904 Expiry Duter 10/19 Checksum 70 41 3789 Step 1: Double the value of every second digit. 167 1698721 14 5 10 9 04 755904 Step 2: If the result of this doubling operation is greater than 9 (e.g. 16), then add the digits of the product (e.g. 1+6=7). 16779872155 90 Step 3: Take the sum of all the digits. 8+1+6+7+7+9+8+7+1+2+5+5+1+9+0+4-80 Step 4: If the total ends in zero, this is a valid card number, If not, it is an invalid card number. 80 ends with a 0 Valid? YES NO Valid Card Number
The Luhn algorithm is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Identifier numbers, ... etc. Write a program in (C++/Java) and Python that reads the text file "CreditCards.txt" and validate each credit card number using Luhn algorithm described below. The program should generate a report displaying the following information on the console: Credit Card 4532971700336820 1 2 5163611731527401 Type Visa MasterCard John Smith After implementing the above program, which programing language would you prefer (C++/Java) or Python? Why? 101BANK CREDIT CARD 4137 8947 1175 5904 Expiry Duter 10/19 Checksum 70 41 3789 Step 1: Double the value of every second digit. 167 1698721 14 5 10 9 04 755904 Step 2: If the result of this doubling operation is greater than 9 (e.g. 16), then add the digits of the product (e.g. 1+6=7). 16779872155 90 Step 3: Take the sum of all the digits. 8+1+6+7+7+9+8+7+1+2+5+5+1+9+0+4-80 Step 4: If the total ends in zero, this is a valid card number, If not, it is an invalid card number. 80 ends with a 0 Valid? YES NO Valid Card Number
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Write only one of them Java or C++ code using a file reading (the file is worth below) CreditCard.txt
***I want to solve as soon as possible.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education