|
|
@ -80,6 +80,41 @@ bool isValidPhoneNumber(char *phoneNumber) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
bool isValidAdress(char *street,int houseNumber,char* city,int postalCode) |
|
|
|
{ |
|
|
|
int maximalLength = 20; |
|
|
|
int minimalLength = 3; |
|
|
|
bool validStreet = true; |
|
|
|
bool validHouseNumber = true; |
|
|
|
bool validCity = true; |
|
|
|
bool validpostalCode = true; |
|
|
|
if(strlen(street)>20 || strlen(street)<3) |
|
|
|
{ |
|
|
|
validStreet = false; |
|
|
|
} |
|
|
|
|
|
|
|
if(strlen(city)>20 || strlen(city)<3) |
|
|
|
{ |
|
|
|
validCity = false; |
|
|
|
} |
|
|
|
if(houseNumber<1 || houseNumber > 999) |
|
|
|
{ |
|
|
|
validHouseNumber = false; |
|
|
|
} |
|
|
|
if(postalCode<1000 || postalCode > 99000) |
|
|
|
{ |
|
|
|
validpostalCode = false; |
|
|
|
} |
|
|
|
if(validStreet && validCity && validHouseNumber && validpostalCode) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int StringLengthCounter(char* string) |
|
|
|
{ |
|
|
|
int characterCounter = 0; |
|
|
|