PROBLEM I: 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+H6- Calculate the remainder when the sum is divided by 10. For the above example, the remainder 27 %10 would be vight. If the result equals zero, then the number is valid. 27 %3D 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 Bank identification number prefix Credit card number length American Express Diners Club Carte Blanche 3437 300-305 15 14 Diners Club International 36 14 Diners Club US and 54 55 16 Canada 6011 622126-622925 644-649 65 Discover Card InstaPayment JCB 16 637-639 16 3528-3589 16 6304 6706 6771 6709 5018 5020 5038 6304|6759|6761|6762|6763 12-19 51-55 Laser 16-19 Maestro 16 Mastercard Visa Visa Electron 4. 13|16 4026 417500 4508|4844|4913|4917 16 For this lab, the student is responsible for generating the data needed to test their program.

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
Answer properly
PROBLEM I: 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++63D 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
Bank identification number prefix
Credit card number
length
American Express
Diners Club Carte Blanche
Diners Club International
34 37
15
300-305
14
36
14
Diners Club US and
Canada
54|55
16
Discover Card
InstaPayment
JCB
6011 622126-622925|644-649|65
637-639
16
16
3528-3589
16
Laser
6304 6706|6771|6709
16-19
Maestro
Mastercard
Visa
Visa Electron
51-55
4.
4026/417500 4508|4844|4913|4917
5018 5020 5038 6304|6759|6761|6762|6763 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 I: 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++63D 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 Bank identification number prefix Credit card number length American Express Diners Club Carte Blanche Diners Club International 34 37 15 300-305 14 36 14 Diners Club US and Canada 54|55 16 Discover Card InstaPayment JCB 6011 622126-622925|644-649|65 637-639 16 16 3528-3589 16 Laser 6304 6706|6771|6709 16-19 Maestro Mastercard Visa Visa Electron 51-55 4. 4026/417500 4508|4844|4913|4917 5018 5020 5038 6304|6759|6761|6762|6763 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

Blurred answer
Knowledge Booster
Analysis of Performance Measurement
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