A console application in C++ using Repl.it to verify user input for an account creation form. The app checks the validity of name, CNP, phone number, and email address, displaying errors if data doesn't meet the required format.
This project aims to create a console application in C++ using Repl.it that verifies the data entered in a form used to create an account on an institution's website. The form includes the following fields:
- Full Name
- CNP (Personal Identification Number)
- Phone Number
- Email Address
The application will perform the following tasks:
-
The user will be prompted to enter the following information:
- Full Name: The user's first name and last name (surname).
- CNP: The user's 13-digit Personal Identification Number.
- Phone Number: The user's 10-digit phone number.
- Email Address: The user's email address.
-
The application will validate each input field to ensure that:
- The "Full Name" field contains only letters and is in the correct format.
- The "CNP" field has exactly 13 digits and starts with a valid code (1, 2, 5, or 6).
- The "Phone Number" field has exactly 10 digits and contains only numbers.
- The "Email Address" is in a valid format, containing '@' and at least one '.' after '@'.
-
If the entered data passes the required validations, the application will display the correct input data, including the user's date of birth (extracted from the CNP) in the format day, month, year.
-
If any of the input data fails the validation, the application will display an error message, specifying the validation issue for each field that didn't meet the required format.
To run the project code please click the link below:
Proiect integrator / Repl.it
Here are some example input data and their corresponding output from the program.
![Screenshot 2022-07-04 at 19 51 38](https://private-user-images.githubusercontent.com/48211193/253808509-9c200a90-9857-4983-8bda-a609d5cfc663.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMTgxNTYsIm5iZiI6MTcyNjAxNzg1NiwicGF0aCI6Ii80ODIxMTE5My8yNTM4MDg1MDktOWMyMDBhOTAtOTg1Ny00OTgzLThiZGEtYTYwOWQ1Y2ZjNjYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDAxMjQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1ZjI1ZTk0M2Y0YWQyMzU5NGY4NTRjOTI5ZjEzMDA3MDFmODc5OWI0ZTgwNzAwZmZhYTk4YzQ4YmE4OWNhYTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.e1XbC7o-9t5uPCMNfJZBb4uZLN9ZRFqtw55a0-wVkDg)
![Screenshot 2022-07-04 at 19 51 55](https://private-user-images.githubusercontent.com/48211193/253808515-9b96ad10-9a93-41ac-9a53-d406fedfc86b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMTgxNTYsIm5iZiI6MTcyNjAxNzg1NiwicGF0aCI6Ii80ODIxMTE5My8yNTM4MDg1MTUtOWI5NmFkMTAtOWE5My00MWFjLTlhNTMtZDQwNmZlZGZjODZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDAxMjQxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxNTYzYWQzM2IxYjFhODBhZDUxOWY1YmNlY2U3NjVmNDUzMmI2NGFjZTI1MzhiNTk1YmVmNGE1ZGI0YzJiMmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.q2hp-qE81SKKIv4y-0bu7kItv4SSmY-X-txOSm69PxI)
If you have any questions or suggestions, feel free to reach out to me at [[email protected]].
In the code, "in-line" comments are used to explain various sections.