Question
Credit Card Number Validation Here is the provided main: bool isvalidcc( const string&); int main() { // // PLEASE DO NOT CHANGE function main //
Credit Card Number Validation
Here is the provided main:
bool isvalidcc(const string&);
int main()
{
//
// PLEASE DO NOT CHANGE function main
//
vector
"371449635398431", "4444444444444448", "4444424444444440", "4110144110144115",
"4114360123456785", "4061724061724061", "5500005555555559", "5115915115915118",
"5555555555555557", "6011016011016011", "372449635398431", "4444544444444448",
"4444434444444440", "4110145110144115", "4124360123456785", "4062724061724061",
"5501005555555559", "5125915115915118", "5556555555555557", "6011116011016011",
"372449635397431", "4444544444444448", "4444434444544440", "4110145110184115",
"4124360123457785", "4062724061724061", "5541005555555559", "5125115115915118",
"5556551555555557", "6011316011016011"
};
int i;
vector
for (i = 1, itr = cardnumbers.begin(); itr != cardnumbers.end(); ++itr, i++) {
cout
}
return 0;
}
2. Our program must produce identical output: ASMTO2 PtA 4388576018402626 and ASMT02 PA Run2.txt 2*2=4 PART B-Credit Card Number Validation, 10 points 42-8 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 1*2=2 6 2 12 (1 +2-3) 5 2 10 (1 +0 1) 8 * 2 = 16 (1+6=7) 4 2 8 Example: Validating 4388576018402626 a) Double every second digit from right to left. If doubling of a digit results 1 371449635398431 is valid 2 4444444444444449 is valid 3 4444424444444440 is valid 4 4110144110144115 is valid 5 4114360123456785 is valid 6 4061724061724061 is valid 7 5500005555555559 is valid 8 5115915115915118 is valid 9 5555555555555557 is valid 10 6011016011016011 is valid in a two-digit number, add the two digits to get a single digit number b) c) d) e) Now add all single-digit numbers from Step a: Add all digits in the odd places from right to left in the card number: Sum the results from Step b and Step c: If the result from Step d is divisible by 10, the card number is valid; 4 +4+8+2+3+1+7+8 37 6+6+0+8+0+7+ 8+3-38 37+38 75 11 372449635398431 is not valid 12 4444544444444448 is not valid 13 4444434444444440 1s not valid 14 4110145110144115 is not valid 15 4124360123456785 is not valid 16 4062724061724061 is not valid 17 5501005555555559 is not valid 3. Your program must produce identical output: ASMTO2_PB_Run.pdf 19 5125915115915118 is not valid otherwise, it is invalid. Please implement Credit Card Number Validation: Function main is provided. Please implement isvalidcc and other functions which you may add to the program. Please do not change function main 1. 2Step 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