etermine if the credit card nu 9173 is VALID or NOT?

MATLAB: An Introduction with Applications
6th Edition
ISBN:9781119256830
Author:Amos Gilat
Publisher:Amos Gilat
Chapter1: Starting With Matlab
Section: Chapter Questions
Problem 1P
icon
Related questions
Question
a) Determine if the credit card number: 4578 4562
5643 9173 is VALID or NOT?
Transcribed Image Text:a) Determine if the credit card number: 4578 4562 5643 9173 is VALID or NOT?
Application 5: Credit Cards
Like ISBN and UPC codes, credit card numbers can be easily checked by the "check digit". In the
Philippines, Visa and Master cards are the dominant credit cards in the market, normally 16-digit except
for some Visa cards that have 13 digits only.
Credit cards numbers can be checked by doubling every other digit starting from the second (when
counted from the right) to the last digit (the last digit being check digit), and summing up all resulting
numbers. If the doubled digit results in a 2-digit number, simply treat the two digits as separate digits. The
card number is valid only if the sum of the digits under modulo 10 is congruent to 0.
Example
Determine which credit card number is valid and which is not valid.
a) 5234 8213 3410 1298
b) 6011 0123 9145 2317
Solutions
a)
Digits
52 3
8 2
13
4 10 1 2 9 8
4
Doubled
(alternate)
10 2
16 2
6 4 2 0 2 2 18 8
3
Sum = 1+0+2 + 6 + 4 +1+6+ 2 +2 +3+ 6+ 4 + 2 +0+2 + 2 +1+8+8 = 60 mod 10 = 0,
the indicated credit card number is VALID.
b)
Digits 6 0 1
101
2 391 4 5 2 3 17
Doubled
12 0 2 1 01 4 3
18 18 5 4 3 2 7
(alternate)
Sum = 1+ 2+0 + 2 +1+0 + 4 + 3 +1+8 +1+ 8+5 +4 +3 + 2 +7
= 53 mod 10 = 3, the indicated credit card number is INVALID.
2.
4.
6
Transcribed Image Text:Application 5: Credit Cards Like ISBN and UPC codes, credit card numbers can be easily checked by the "check digit". In the Philippines, Visa and Master cards are the dominant credit cards in the market, normally 16-digit except for some Visa cards that have 13 digits only. Credit cards numbers can be checked by doubling every other digit starting from the second (when counted from the right) to the last digit (the last digit being check digit), and summing up all resulting numbers. If the doubled digit results in a 2-digit number, simply treat the two digits as separate digits. The card number is valid only if the sum of the digits under modulo 10 is congruent to 0. Example Determine which credit card number is valid and which is not valid. a) 5234 8213 3410 1298 b) 6011 0123 9145 2317 Solutions a) Digits 52 3 8 2 13 4 10 1 2 9 8 4 Doubled (alternate) 10 2 16 2 6 4 2 0 2 2 18 8 3 Sum = 1+0+2 + 6 + 4 +1+6+ 2 +2 +3+ 6+ 4 + 2 +0+2 + 2 +1+8+8 = 60 mod 10 = 0, the indicated credit card number is VALID. b) Digits 6 0 1 101 2 391 4 5 2 3 17 Doubled 12 0 2 1 01 4 3 18 18 5 4 3 2 7 (alternate) Sum = 1+ 2+0 + 2 +1+0 + 4 + 3 +1+8 +1+ 8+5 +4 +3 + 2 +7 = 53 mod 10 = 3, the indicated credit card number is INVALID. 2. 4. 6
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
Statistics
ISBN:
9781119256830
Author:
Amos Gilat
Publisher:
John Wiley & Sons Inc
Probability and Statistics for Engineering and th…
Probability and Statistics for Engineering and th…
Statistics
ISBN:
9781305251809
Author:
Jay L. Devore
Publisher:
Cengage Learning
Statistics for The Behavioral Sciences (MindTap C…
Statistics for The Behavioral Sciences (MindTap C…
Statistics
ISBN:
9781305504912
Author:
Frederick J Gravetter, Larry B. Wallnau
Publisher:
Cengage Learning
Elementary Statistics: Picturing the World (7th E…
Elementary Statistics: Picturing the World (7th E…
Statistics
ISBN:
9780134683416
Author:
Ron Larson, Betsy Farber
Publisher:
PEARSON
The Basic Practice of Statistics
The Basic Practice of Statistics
Statistics
ISBN:
9781319042578
Author:
David S. Moore, William I. Notz, Michael A. Fligner
Publisher:
W. H. Freeman
Introduction to the Practice of Statistics
Introduction to the Practice of Statistics
Statistics
ISBN:
9781319013387
Author:
David S. Moore, George P. McCabe, Bruce A. Craig
Publisher:
W. H. Freeman