Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Worksheet -1

Practicing Different Validations Using Pseudocode

1. Write a pseudocode that prompts the user to enter their age and validates that the input is a
positive integer. If the input is not valid, ask the user to enter again.
2. Write a pseudocode that prompts the user to enter a score between 0 and 100. Validate that
the input is within this range.
3. Write a pseudocode that prompts the user to enter a password. The password must be at
least 8 characters long. Validate the length of the password.
4. Write a pseudocode that prompts the user to enter their email address. Validate that the
email contains "@" and "." characters.
5. Write a pseudocode that prompts the user to enter their phone number. Validate that the
phone number contains exactly 10 digits.
6. Write a pseudocode that prompts the user to enter their name. Validate that the input is not
empty.
7. Write a pseudocode that presents a menu of options (1-3) to the user and validates their
selection.
8. Write a pseudocode that prompts the user to enter a username and checks if it is unique by
comparing it with an existing list of usernames( user names are stored in array).
9. Write a pseudocode that prompts the user to enter a postal code and validates that it follows
a specific pattern (e.g., 5 digits for US ZIP codes).
10. Write a pseudocode that prompts the user to enter a number and validates that it is
numeric.
11. Write a pseudocode that presents a multiple-choice question to the user and validates their
selection.
12. Write a pseudocode that prompts the user to enter a time in the format HH:MM and
validates the input.
13. Write a pseudocode that prompts the user to enter a URL and validates that it follows the
correct format (e.g., starts with "http://" or "https://").
14. Write a pseudocode that prompts the user to enter a hexadecimal color code and validates
that it follows the correct format (e.g., "#RRGGBB").
15. Write a pseudocode that prompts the user to enter an IPv4 address and validates that it
follows the correct format (e.g., "192.168.1.1")
16. Write a pseudocode that prompts the user to enter a time in the 24-hour format
(HH:MM) and validates the input.
17. Write a pseudocode that prompts the user to enter a MAC address and validates that it
follows the correct format (e.g., "00:1A:2B:3C:4D:5E").

18. Write a pseudocode that prompts the user to enter a date in the format
DD/MM/YYYY. Validate that the input follows this format.

You might also like