PROBLEM 1: Have you ever wondered how websites validate your credit card number when you shop online? They do not check a large database of numbers. Most credit providers rely on a checksum formula for distinguishing valid numbers from random collections of digits (or typing mistakes). The objective of this lab you will implement a program that read a file that contains a table with two columns: A column of customer names and a column of credit card numbers. For each customer, print the validity of the credit card number and name of the corresponding credit card company (if the number is valid), For our purpose, the algorithm that valid credit cards is the following: Double the value of every second digit beginning from the right. That is, the last digit is unchanged; the second-to-last digit is doubled; the third-to-last digit is unchanged; and so on. For example, [1,3,8,6] becomes [2,3,16,6] Add the digits of the doubled values and the undoubled digits from the original number. For example, [2,3,16,6] becomes 2+3+1+6-27 Calculate the remainder when the sum is divided by 10. For the above example, the remainder would be eight. If the result equals zero, then the number is valid. seven You can use the information below to map the name of a credit card company to a valid credit card number. Credit card brand ● . . American Express Diners Club Carte Blanche Diners Club International Diners Club US and Canada Discover Card InstaPayment JCB Laser Maestro Mastercard Visa Visa Electron Bank identification number prefix 34/37 300-305 36 54155 6011622126-622925644-649165 637-639 3528-3589 6304 6706 6771 6709 50185020 5038|6304|6759|6761|6762|6763 51-55 4026417500/4508|4844/4913/4917 Credit card number length 1446 15 16 16 16 16-19 12-19 16 1316 16 For this lab, the student is responsible for generating the data needed to test their program. 27 %10 7
PROBLEM 1: Have you ever wondered how websites validate your credit card number when you shop online? They do not check a large database of numbers. Most credit providers rely on a checksum formula for distinguishing valid numbers from random collections of digits (or typing mistakes). The objective of this lab you will implement a program that read a file that contains a table with two columns: A column of customer names and a column of credit card numbers. For each customer, print the validity of the credit card number and name of the corresponding credit card company (if the number is valid), For our purpose, the algorithm that valid credit cards is the following: Double the value of every second digit beginning from the right. That is, the last digit is unchanged; the second-to-last digit is doubled; the third-to-last digit is unchanged; and so on. For example, [1,3,8,6] becomes [2,3,16,6] Add the digits of the doubled values and the undoubled digits from the original number. For example, [2,3,16,6] becomes 2+3+1+6-27 Calculate the remainder when the sum is divided by 10. For the above example, the remainder would be eight. If the result equals zero, then the number is valid. seven You can use the information below to map the name of a credit card company to a valid credit card number. Credit card brand ● . . American Express Diners Club Carte Blanche Diners Club International Diners Club US and Canada Discover Card InstaPayment JCB Laser Maestro Mastercard Visa Visa Electron Bank identification number prefix 34/37 300-305 36 54155 6011622126-622925644-649165 637-639 3528-3589 6304 6706 6771 6709 50185020 5038|6304|6759|6761|6762|6763 51-55 4026417500/4508|4844/4913/4917 Credit card number length 1446 15 16 16 16 16-19 12-19 16 1316 16 For this lab, the student is responsible for generating the data needed to test their program. 27 %10 7
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
Expert Solution
Step 1
Python use:
Python is a computer programming language that is frequently used to create websites and applications, automate operations, and analyze data. Python is a general-purpose programming language, which means it can be used to develop a wide range of applications and is not specialized for any particular problem.
Step by step
Solved in 3 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