Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a code that inputs a string of 16 numbers as a string, not numbers. Then use str2num to convert the string numbers to real

image text in transcribed
Develop a code that inputs a string of 16 numbers as a string, not numbers. Then use str2num to convert the string numbers to real numbers as needed Some credit card numbers may be validated using the Luhn algorithm: The Luhn Formula: Drop the last digit from the number. The last digit is what we want to check against Reverse the numbers Multiply the digits in odd positions (1, 3, 5, etc.) by 2 and subtract 9 to all any result higher than 9 Add all the numbers together The check digit (the last number of the card) is the amount that you would need to add to get a multiple of 10 (Modulo 10), check your code with this number and your card number, but don't include your card number in the code please. Luhn Example: Step Total Original Number: s Drop the last digit: Reverse the digits: 4 s s 6 9 3 7 5 8 6 8 9 9 8 5 4 55 67 37 8 6 8 9 9 8 5 898 68 7 3 7 6 5 4 10 8 18 9 16 6 16 5 14 3 14 6 10 5 8 8 9 9 7 6 7 5 3 6 5 8 8 9 9 9 6 7 ss 356 38 Multiple odd digits by 2: Subtract 9 to numbers over 9: Add all numbers: Mod 10: 85 modulo 10 - 5 (last digit of card) Definition of modulo: a modulo bisc, it means that the remainder when a is divided by bisc

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

Describe how to train managers to coach employees. page 404

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 381

Answered: 1 week ago