12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include <iostream>
- #include <string>
-
- using namespace std;
-
-
-
-
- bool isUsername(const string &username){
-
-
- return 1 ;
- }
-
-
- bool isPassword(const string &password){
-
-
- return 1 ;
- }
-
- int main()
- {
-
- string password, username, repassword;
- bool flaguser = false, flagpass = false;
- cout << "Please enter username (Student number, with or without dash): ";
- cin >> username;
- do{
- if(isUsername(username)){
- flaguser = true;
- cout << "The username is correct." << endl;
- }
- else{
- cout << "Please enter a correct username: ";
- cin >> username;
- }
- }while(!flaguser);
-
- cout << endl;
- cout << "Please enter a password with the following conditions: " << endl;
- cout << "\t1. 8 or more characters" << endl;
- cout << "\t2. At least 1 upper case letter" << endl;
- cout << "\t3. At least 1 digit" << endl;
- cout << "\t4. At least 1 symbol" << endl << endl;
- do{
- cout << "Please enter password: ";
- cin >> password;
- if(password.length() >= 8){
- if(isPassword(password)){
- cout << "Please reenter the password: ";
- cin >> repassword;
- if(password == repassword){
- cout << "The password matched." << endl;
- flagpass = true;
- }
- else {
- cout << "The password did not matched." << endl;
- }
- }
- else{
- cout << "The password did not pass the conditions." << endl;
- }
- }
- }while(!flagpass);
- cout << "Congratulations, you have succesfully created an account!" << endl;
-
- return 0;
- }
|