|
@ -82,18 +82,15 @@ bool isValidPhoneNumber(char *phoneNumber) |
|
|
|
|
|
|
|
|
bool isValidAdress(char *street,char* city,int houseNumber,int postalCode) |
|
|
bool isValidAdress(char *street,char* city,int houseNumber,int postalCode) |
|
|
{ |
|
|
{ |
|
|
int lengthMax = 20; |
|
|
|
|
|
int LengthMin = 3; |
|
|
|
|
|
bool validStreet = true; |
|
|
bool validStreet = true; |
|
|
bool validHouseNumber = true; |
|
|
bool validHouseNumber = true; |
|
|
bool validCity = true; |
|
|
bool validCity = true; |
|
|
bool validpostalCode = true; |
|
|
bool validpostalCode = true; |
|
|
if(strlen(street)>lengthMax || strlen(street)<LengthMin) |
|
|
|
|
|
|
|
|
if(strlen(street)>maximalAdressLength || strlen(street)<minimalAdressLength) |
|
|
{ |
|
|
{ |
|
|
validStreet = false; |
|
|
validStreet = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(strlen(city)>lengthMax || strlen(city)<LengthMin) |
|
|
|
|
|
|
|
|
if(strlen(city)>maximalAdressLength || strlen(city)<minimalAdressLength) |
|
|
{ |
|
|
{ |
|
|
validCity = false; |
|
|
validCity = false; |
|
|
} |
|
|
} |
|
@ -105,13 +102,7 @@ bool isValidAdress(char *street,char* city,int houseNumber,int postalCode) |
|
|
{ |
|
|
{ |
|
|
validpostalCode = false; |
|
|
validpostalCode = false; |
|
|
} |
|
|
} |
|
|
if(validStreet==true && validCity==true && validHouseNumber==true && validpostalCode==true) |
|
|
|
|
|
{ |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
{ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return (validStreet && validCity && validHouseNumber && validpostalCode); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int StringLengthCounter(char* string) |
|
|
int StringLengthCounter(char* string) |
|
|