|
@ -45,42 +45,42 @@ void ageInput() |
|
|
|
|
|
|
|
|
while (true) |
|
|
while (true) |
|
|
{ |
|
|
{ |
|
|
/*the userInput string is changed to a number with the strtol function*/ |
|
|
|
|
|
|
|
|
/*the userInput string is changed to a number with the strtol function*/ |
|
|
|
|
|
|
|
|
age = strtol(userInput,&userInputPointer,10); |
|
|
|
|
|
|
|
|
age = strtol(userInput,&userInputPointer,10); |
|
|
|
|
|
|
|
|
if((checkIfInteger(userInput))&& (agePermission(age))) |
|
|
if((checkIfInteger(userInput))&& (agePermission(age))) |
|
|
{ |
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
printf("Access granted!\n\n\n\n"); |
|
|
|
|
|
|
|
|
printf("Access granted!\n\n\n\n"); |
|
|
|
|
|
|
|
|
showMenu(); |
|
|
|
|
|
|
|
|
showMenu(); |
|
|
|
|
|
|
|
|
menuInput(); |
|
|
|
|
|
|
|
|
menuInput(); |
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
else if((checkIfInteger(userInput)) && !(agePermission(age))) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
else if((checkIfInteger(userInput)) && !(agePermission(age))) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
printf("You should be at least 18 years old to create a bank account!\n"); |
|
|
printf("You should be at least 18 years old to create a bank account!\n"); |
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
printf("input invalid! try again!\n"); |
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
printf("input invalid! try again!\n"); |
|
|
|
|
|
|
|
|
scanf("%s",userInput); |
|
|
scanf("%s",userInput); |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void menuInput() |
|
|
void menuInput() |
|
|