Algorithm to Collect and Validate User Information
1. Initialize Loop to Get Name:
- Repeat the following steps until valid input is obtained:
- Prompt the user to "Enter your name".
- If the input consists only of alphabetic characters:
- Exit the loop.
- Otherwise:
- Raise a `TypeError`.
- Display the error message: "Invalid Input. Please enter a string."
2. Initialize Loop to Get Surname:
- Repeat the following steps until valid input is obtained:
- Prompt the user to "Enter your surname".
- If the input consists only of alphabetic characters:
- Exit the loop.
- Otherwise:
- Raise a `TypeError`.
- Display the error message: "Invalid. Please enter a string."
3. Initialize Loop to Get Age:
- Repeat the following steps until valid input is obtained:
- Prompt the user to "Enter your age".
- If the input consists only of numeric characters:
- Exit the loop.
- Otherwise:
- Raise a `TypeError`.
- Display the error message: "Invalid Input. Please enter an Integer."
4. Initialize Loop to Get Height:
- Repeat the following steps until valid input is obtained:
- Prompt the user to "Enter your height".
- If the input is entirely numeric:
- Raise a `TypeError` and display the message "Invalid Input. Please enter a
float(decimal) value."
- If the input contains alphabetic characters:
- Raise a `TypeError` and display the message "Invalid Input. Please enter a
float(decimal) value."
- Otherwise:
- Exit the loop.
5. Initialize Loop to Get Weight:
- Repeat the following steps until valid input is obtained:
- Prompt the user to "Enter your weight".
- If the input consists only of alphabetic characters:
- Raise a `TypeError` and display the message "Invalid Input. Please enter a
float(decimal) value."
- If the input is entirely numeric:
- Raise a `TypeError` and display the message "Invalid Input. Please enter a
float(decimal) value."
- Otherwise:
- Exit the loop.
6. End of Algorithm.