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
icon
Related questions
Question
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 27 %10
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-649|65
637-639
3528-3589
6304 6706 6771 6709
50185020 5038|6304|6759|6761|6762/6763
51-55
4
4026417500/4508|4844/49134917
Credit card number
length
15
14
14
16
16
16
16
16-19
12-19
16
13|16
16
For this lab, the student is responsible for generating the data needed to test their program.
Transcribed Image Text: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 27 %10 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-649|65 637-639 3528-3589 6304 6706 6771 6709 50185020 5038|6304|6759|6761|6762/6763 51-55 4 4026417500/4508|4844/49134917 Credit card number length 15 14 14 16 16 16 16 16-19 12-19 16 13|16 16 For this lab, the student is responsible for generating the data needed to test their program.
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Array
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education