Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c++ 2-24 2- 2-4 4 2 8 1 2 2 PART B-Credit Card Number Validation, 10 points Credit card numbers follow certain patterns. A
in c++
2-24 2- 2-4 4 2 8 1 2 2 PART B-Credit Card Number Validation, 10 points Credit card numbers follow certain patterns. A credit card number must have between 13 and 16 digits. The starting numbers are: 4 for Visa cards, 5 for MasterCard cards, 37 for American Express cards, and 6 for Discover cards 6-2 12 (1+2 3) 5-2 10 (101) 8-2-16 (1+6-7 Example: Validating 4388576018402626 4-2 8 a) Double every second digit from right to left. If doubling of a digit results37445635393431 444444444444448 valid valid a two-digit number, add the two digits to get a single digit number. 2 b) Now add all single-digit numbers from Step a c) Add all digits in the odd places from right to left in the card number d) Sum the results from Step b and Step e) If the result from Step d is divisible by 10, the card number is valid; 4+4+8+2+3+1+7+8 3 6+6+0+8+0+7+8+3 38 37 + 38 75 3 4444424444444440 18 valid 4 4110144110144115 1 valid 5 421436012345678s is valid 6 4061724061724061 8 valid 7 5500005555555559 1s valad 5115915115915110 1S valid 9 55555555$5555557 1s vai1d 0 6011016011016011 9 valid otherwise, it is invalid 372449635398431 is not valid 12 4444544444444440 is not vaiid 41102451101441is i not valid 5501005555555559 is not valid Please implement Credit Card Number Validation: 1. Function main is provided. Please implement isvalidcc and other 3 4444434444444440 1s not vali functions which you may add to the program. 2. Please do not change function main 3. Your program must produce identical output: ASMTO2 P8 Run.pdf 5 412436012345678s in not valid valid 6 4062724061724061 s not 0 s125925115915 s ia not valid Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started