I have to include an assert for a credit card program, that makes sre the length is between 13-16. Is this correct formatting? Because I enter valid lengths and it returns "invalid length". Thanks
1 2 3 4 5 6 7
bool checkLength(string creditCardNumber)
{
int length;
length=creditCardNumber.length();
cout << "Length of credit card number is:" << " " << length << endl;
assert(length>=13 && length<=16);
}