Question: Write a program in PHYTON PROBLEM 1: Have you ever wondered how websites validate your credit card number when you shop online? They do not
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 ). The objective of for distinguishing valid numbers from random collections of digits (or typing mistakes this lab you will implement a program that read a file that contains a table with two columns: A column of card number customer names and a column of credit card numbers. For each customer, print the validity of the credit 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: uble 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, [23,16,6] becomes 2+3+_+6-n.a Calculate the remainder when the sum is divided by 10. For the above example, the remainder would be eight. Ifthe result equals zero, then the number is valid. %10 You can use the information below to map the name of a credit card company to a valid credit number Credit card number length 15 Credit card brand Bank identification number prefix American Ex 34137 Diners Club Carte Blanche 300-305 Diners Club International 36 Diners Club US and Canada Discover Card InstaPayment CB Laser Maestro 54155 16 6011622126-622925644-64965 637-639 3528-3589 63046706 67716709 16 16 16-19 16 Mastercard Visa Visa Electron 51-55 13 16 40264175004508 48444913491716 For this lab, the student is responsible for generating the data needed to test their program. This problem is adapted from the first practicum assigned in the University of Utrecht functional programming course taught by Doaitse Swierstra, 2008-2009
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
